* Runs state functionality every cycle. * Ends the panicking when done. */
| 49 | * Ends the panicking when done. |
| 50 | */ |
| 51 | void UnitPanicBState::think() |
| 52 | { |
| 53 | // reset the unit's time units when all panicking is done |
| 54 | if (_unit) |
| 55 | { |
| 56 | if (!_unit->isOut()) |
| 57 | { |
| 58 | _unit->abortTurn(); // set the unit status to standing in case it wasn't otherwise changed from berserk/panicked |
| 59 | } |
| 60 | _unit->setTimeUnits(0); |
| 61 | } |
| 62 | _parent->popState(); |
| 63 | _parent->setupCursor(); |
| 64 | } |
| 65 | |
| 66 | /** |
| 67 | * Panicking cannot be cancelled. |
nothing calls this directly
no test coverage detected