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

Method WaitIfNoTarget

src/Ext/Script/Body.cpp:582–600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

580}
581
582void ScriptExt::WaitIfNoTarget(TeamClass* pTeam, int attempts)
583{
584 // This method modifies the new attack actions preventing Team's Trigger to jump to next script action
585 // attempts == number of times the Team will wait if Mission_Attack(...) can't find a new target.
586 if (attempts < 0)
587 attempts = pTeam->CurrentScript->Type->ScriptActions[pTeam->CurrentScript->CurrentMission].Argument;
588
589 auto const pTeamData = TeamExt::ExtMap.Find(pTeam);
590
591 if (attempts <= 0)
592 pTeamData->WaitNoTargetAttempts = -1; // Infinite waits if no target
593 else
594 pTeamData->WaitNoTargetAttempts = attempts;
595
596 // This action finished
597 pTeam->StepCompleted = true;
598
599 return;
600}
601
602void ScriptExt::TeamWeightReward(TeamClass* pTeam, double award)
603{

Callers

nothing calls this directly

Calls 1

FindMethod · 0.45

Tested by

no test coverage detected