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

Method spendTimeUnits

src/Savegame/BattleUnit.cpp:1157–1168  ·  view source on GitHub ↗

* Spend time units if it can. Return false if it can't. * @param tu * @return flag if it could spend the time units or not. */

Source from the content-addressed store, hash-verified

1155 * @return flag if it could spend the time units or not.
1156 */
1157bool BattleUnit::spendTimeUnits(int tu)
1158{
1159 if (tu <= _tu)
1160 {
1161 _tu -= tu;
1162 return true;
1163 }
1164 else
1165 {
1166 return false;
1167 }
1168}
1169
1170/**
1171 * Spend energy if it can. Return false if it can't.

Callers 15

thinkMethod · 0.80
thinkMethod · 0.80
thinkMethod · 0.80
kneelMethod · 0.80
handleNonTargetActionMethod · 0.80
popStateMethod · 0.80
handlePanickingUnitMethod · 0.80
primaryActionMethod · 0.80
takeItemFromGroundMethod · 0.80
onHealClickMethod · 0.80
onStimulantClickMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected