| 1312 | } |
| 1313 | |
| 1314 | bool BattleUnitMission::spendAgentTUs(GameState &state, BattleUnit &u, int cost, bool cancel, |
| 1315 | bool ignoreKneelReserve, bool allowInterrupt) |
| 1316 | { |
| 1317 | if (costPaidUpFront > 0) |
| 1318 | { |
| 1319 | if (costPaidUpFront >= cost) |
| 1320 | { |
| 1321 | costPaidUpFront -= cost; |
| 1322 | cost = 0; |
| 1323 | } |
| 1324 | else |
| 1325 | { |
| 1326 | cost -= costPaidUpFront; |
| 1327 | costPaidUpFront = 0; |
| 1328 | } |
| 1329 | } |
| 1330 | |
| 1331 | if (u.spendTU(state, cost, ignoreKneelReserve, false, allowInterrupt)) |
| 1332 | { |
| 1333 | return true; |
| 1334 | } |
| 1335 | if (cancel) |
| 1336 | { |
| 1337 | cancelled = true; |
| 1338 | } |
| 1339 | else |
| 1340 | { |
| 1341 | u.addMission(state, BattleUnitMission::Type::AcquireTU); |
| 1342 | } |
| 1343 | return false; |
| 1344 | } |
| 1345 | |
| 1346 | bool BattleUnitMission::getNextDestination(GameState &state, BattleUnit &u, Vec3<float> &dest) |
| 1347 | { |
nothing calls this directly
no test coverage detected