* Gets the highest ranked, living XCom unit. * @return The highest ranked, living XCom unit. */
| 1544 | * @return The highest ranked, living XCom unit. |
| 1545 | */ |
| 1546 | BattleUnit* SavedBattleGame::getHighestRankedXCom() |
| 1547 | { |
| 1548 | BattleUnit* highest = 0; |
| 1549 | for (std::vector<BattleUnit*>::iterator j = _units.begin(); j != _units.end(); ++j) |
| 1550 | { |
| 1551 | if ((*j)->getOriginalFaction() == FACTION_PLAYER && !(*j)->isOut()) |
| 1552 | { |
| 1553 | if (highest == 0 || (*j)->getRankInt() > highest->getRankInt()) |
| 1554 | { |
| 1555 | highest = *j; |
| 1556 | } |
| 1557 | } |
| 1558 | } |
| 1559 | return highest; |
| 1560 | } |
| 1561 | |
| 1562 | /** |
| 1563 | * Gets the morale modifier for |
nothing calls this directly
no test coverage detected