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

Method lessEngineer

src/Basescape/ManufactureInfoState.cpp:321–332  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

319 * @param change How much we want to subtract.
320 */
321void ManufactureInfoState::lessEngineer(int change)
322{
323 if (0 >= change) return;
324 int assigned = _production->getAssignedEngineers();
325 if(assigned > 0)
326 {
327 change = std::min(assigned, change);
328 _production->setAssignedEngineers(assigned-change);
329 _base->setEngineers(_base->getEngineers()+change);
330 setAssignedEngineer();
331 }
332}
333
334/**
335 * Starts the timerLessEngineer.

Callers

nothing calls this directly

Calls 4

getAssignedEngineersMethod · 0.80
setAssignedEngineersMethod · 0.80
getEngineersMethod · 0.80
setEngineersMethod · 0.45

Tested by

no test coverage detected