MCPcopy Create free account
hub / github.com/Phobos-developers/Phobos / SetCloseEnoughDistance

Method SetCloseEnoughDistance

src/Ext/Script/Body.cpp:668–686  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

666}
667
668void ScriptExt::SetCloseEnoughDistance(TeamClass* pTeam, double distance)
669{
670 // This passive method replaces the CloseEnough value from rulesmd.ini by a custom one. Used by Mission_Move()
671 if (distance <= 0)
672 distance = pTeam->CurrentScript->Type->ScriptActions[pTeam->CurrentScript->CurrentMission].Argument;
673
674 auto const pTeamData = TeamExt::ExtMap.Find(pTeam);
675
676 if (distance > 0)
677 pTeamData->CloseEnough = distance;
678
679 if (distance <= 0)
680 pTeamData->CloseEnough = RulesClass::Instance->CloseEnough / (double)Unsorted::LeptonsPerCell;
681
682 // This action finished
683 pTeam->StepCompleted = true;
684
685 return;
686}
687
688void ScriptExt::UnregisterGreatSuccess(TeamClass* pTeam)
689{

Callers

nothing calls this directly

Calls 1

FindMethod · 0.45

Tested by

no test coverage detected