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

Method selectUnit

src/Savegame/SavedBattleGame.cpp:692–704  ·  view source on GitHub ↗

* Selects the unit at the given position on the map. * @param pos Position. * @return Pointer to a BattleUnit, or 0 when none is found. */

Source from the content-addressed store, hash-verified

690 * @return Pointer to a BattleUnit, or 0 when none is found.
691 */
692BattleUnit *SavedBattleGame::selectUnit(const Position& pos)
693{
694 BattleUnit *bu = getTile(pos)->getUnit();
695
696 if (bu && bu->isOut())
697 {
698 return 0;
699 }
700 else
701 {
702 return bu;
703 }
704}
705
706/**
707 * Gets the list of nodes.

Callers 2

drawTerrainMethod · 0.80
primaryActionMethod · 0.80

Calls 2

isOutMethod · 0.80
getUnitMethod · 0.45

Tested by

no test coverage detected