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

Method ExecuteTimedAreaGuardAction

src/Ext/Script/Body.cpp:233–251  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

231}
232
233void ScriptExt::ExecuteTimedAreaGuardAction(TeamClass* pTeam)
234{
235 auto const pScript = pTeam->CurrentScript;
236 auto const pScriptType = pScript->Type;
237
238 if (pTeam->GuardAreaTimer.TimeLeft == 0 && !pTeam->GuardAreaTimer.InProgress())
239 {
240 for (auto pUnit = pTeam->FirstUnit; pUnit; pUnit = pUnit->NextTeamMember)
241 pUnit->QueueMission(Mission::Area_Guard, true);
242
243 pTeam->GuardAreaTimer.Start(15 * pScriptType->ScriptActions[pScript->CurrentMission].Argument);
244 }
245
246 if (pTeam->GuardAreaTimer.Completed())
247 {
248 pTeam->GuardAreaTimer.Stop(); // Needed
249 pTeam->StepCompleted = true;
250 }
251}
252
253void ScriptExt::LoadIntoTransports(TeamClass* pTeam)
254{

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected