MCPcopy Create free account
hub / github.com/OpenXcom/OpenXcom / think

Method think

src/Battlescape/UnitPanicBState.cpp:51–64  ·  view source on GitHub ↗

* Runs state functionality every cycle. * Ends the panicking when done. */

Source from the content-addressed store, hash-verified

49 * Ends the panicking when done.
50 */
51void 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.

Callers

nothing calls this directly

Calls 5

isOutMethod · 0.80
abortTurnMethod · 0.80
setTimeUnitsMethod · 0.80
setupCursorMethod · 0.80
popStateMethod · 0.45

Tested by

no test coverage detected