* Adds this unit to the vector of falling units, * if it doesn't already exist. * @param unit The unit. * @return Was the unit added? */
| 1494 | * @return Was the unit added? |
| 1495 | */ |
| 1496 | bool 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. |
no outgoing calls
no test coverage detected