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

Method btnUnitDownClick

src/Battlescape/BattlescapeState.cpp:815–822  ·  view source on GitHub ↗

* Moves the selected unit down. * @param action Pointer to an action. */

Source from the content-addressed store, hash-verified

813 * @param action Pointer to an action.
814 */
815void BattlescapeState::btnUnitDownClick(Action *)
816{
817 if (playableUnitSelected() && _save->getPathfinding()->validateUpDown(_save->getSelectedUnit(), _save->getSelectedUnit()->getPosition(), Pathfinding::DIR_DOWN))
818 {
819 _battleGame->cancelCurrentAction();
820 _battleGame->moveUpDown(_save->getSelectedUnit(), Pathfinding::DIR_DOWN);
821 }
822}
823
824/**
825 * Shows the next map layer.

Callers

nothing calls this directly

Calls 6

validateUpDownMethod · 0.80
getSelectedUnitMethod · 0.80
cancelCurrentActionMethod · 0.80
moveUpDownMethod · 0.80
getPathfindingMethod · 0.45
getPositionMethod · 0.45

Tested by

no test coverage detected