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

Method RunComputerReturn

bwapi/BWScriptEmulator/ComputerReturn.cpp:4–37  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2
3
4void UnitWrap::RunComputerReturn()
5{
6 if ( TaskAggression() )
7 return;
8
9 if ( pUnit->getType() == UnitTypes::Terran_Medic /*&& MedicOrders()*/ )
10 return;
11
12 // order state is 0
13 if ( !GetOrderState() )
14 {
15 pUnit->move( GetOrderTargetPosition() ); // temporary
16
17 //if ( MoveToTarget() and not getting AI Transport Assist )
18 SetOrderState(1);
19 }
20
21 if ( GetOrderState() )
22 {
23 if ( GetControlType() == ControlTypes::Guard )
24 {
25 if ( GetOrderTargetPosition() == pUnit->getPosition() ) // Reached destination
26 {
27 SetGuardReturnPosition(pUnit->getPosition());
28 SetVirtualUnitOrder(Orders::Enum::Guard);
29 }
30 }
31 else
32 {
33 SetVirtualUnitOrder(Orders::Enum::ComputerAI);
34 }
35 }
36
37}

Callers

nothing calls this directly

Calls 3

getTypeMethod · 0.45
moveMethod · 0.45
getPositionMethod · 0.45

Tested by

no test coverage detected