| 580 | } |
| 581 | |
| 582 | void 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 | |
| 602 | void ScriptExt::TeamWeightReward(TeamClass* pTeam, double award) |
| 603 | { |