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

Method lessUnit

src/Basescape/ManufactureInfoState.cpp:434–441  ·  view source on GitHub ↗

* Removes the given number of units to produce from the project if possible. * @param change How much we want to subtract. */

Source from the content-addressed store, hash-verified

432 * @param change How much we want to subtract.
433 */
434void ManufactureInfoState::lessUnit(int change)
435{
436 if (0 >= change) return;
437 int units = _production->getAmountTotal();
438 change = std::min(units-(_production->getAmountProduced()+1), change);
439 _production->setAmountTotal(units-change);
440 setAssignedEngineer();
441}
442
443/**
444 * Starts the timerLessUnit.

Callers

nothing calls this directly

Calls 3

getAmountTotalMethod · 0.80
getAmountProducedMethod · 0.80
setAmountTotalMethod · 0.80

Tested by

no test coverage detected