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

Method btnUnitUpClick

src/Battlescape/BattlescapeState.cpp:802–809  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

800 * @param action Pointer to an action.
801 */
802void BattlescapeState::btnUnitUpClick(Action *)
803{
804 if (playableUnitSelected() && _save->getPathfinding()->validateUpDown(_save->getSelectedUnit(), _save->getSelectedUnit()->getPosition(), Pathfinding::DIR_UP))
805 {
806 _battleGame->cancelCurrentAction();
807 _battleGame->moveUpDown(_save->getSelectedUnit(), Pathfinding::DIR_UP);
808 }
809}
810
811/**
812 * Moves the selected unit down.

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