| 2 | |
| 3 | |
| 4 | void 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 | } |
nothing calls this directly
no test coverage detected