MCPcopy Create free account
hub / github.com/bwapi/bwapi / RunGuardPost

Method RunGuardPost

bwapi/BWScriptEmulator/Guard.cpp:13–38  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

11}
12
13void UnitWrap::RunGuardPost()
14{
15 if ( GetOrderTimer() != 0 )
16 return;
17 SetOrderTimer(15);
18
19 if ( TaskSpellcaster(false) )
20 return;
21
22 if ( TaskAggression() )
23 return;
24
25 if ( pUnit->getType() == UnitTypes::Protoss_Observer )
26 return;
27
28 if ( GetControlType() == ControlTypes::Guard && pUnit->getPosition() != GetGuardReturnPosition() )
29 {
30 if ( pUnit->getType() == UnitTypes::Terran_Siege_Tank_Siege_Mode )
31 pUnit->unsiege();
32 SetVirtualUnitOrder(Orders::Enum::ComputerReturn, GetGuardReturnPosition() );
33 }
34 else
35 {
36 SetVirtualUnitOrder(Orders::Enum::ComputerAI);
37 }
38}

Callers

nothing calls this directly

Calls 3

getTypeMethod · 0.45
getPositionMethod · 0.45
unsiegeMethod · 0.45

Tested by

no test coverage detected