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

Method addFallingUnit

src/Savegame/SavedBattleGame.cpp:1496–1513  ·  view source on GitHub ↗

* Adds this unit to the vector of falling units, * if it doesn't already exist. * @param unit The unit. * @return Was the unit added? */

Source from the content-addressed store, hash-verified

1494 * @return Was the unit added?
1495 */
1496bool SavedBattleGame::addFallingUnit(BattleUnit* unit)
1497{
1498 bool add = true;
1499 for (std::list<BattleUnit*>::iterator i = _fallingUnits.begin(); i != _fallingUnits.end(); ++i)
1500 {
1501 if (unit == *i)
1502 {
1503 add = false;
1504 break;
1505 }
1506 }
1507 if (add)
1508 {
1509 _fallingUnits.push_front(unit);
1510 _unitsFalling = true;
1511 }
1512 return add;
1513}
1514
1515/**
1516 * Gets all units in the battlescape that are falling.

Callers 3

thinkMethod · 0.80
thinkMethod · 0.80
applyGravityMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected