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

Method setUnit

src/Battlescape/Pathfinding.cpp:1148–1159  ·  view source on GitHub ↗

* Sets _unit in order to abuse low-level pathfinding functions from outside the class. * @param unit Unit taking the path. */

Source from the content-addressed store, hash-verified

1146 * @param unit Unit taking the path.
1147 */
1148void Pathfinding::setUnit(BattleUnit* unit)
1149{
1150 _unit = unit;
1151 if (unit != 0)
1152 {
1153 _movementType = unit->getArmor()->getMovementType();
1154 }
1155 else
1156 {
1157 _movementType = MT_WALK;
1158 }
1159}
1160
1161/**
1162 * Checks whether a modifier key was used to enable strafing or running.

Callers 9

nextStageMethod · 0.45
deployXCOMMethod · 0.45
thinkMethod · 0.45
setupAmbushMethod · 0.45
thinkMethod · 0.45
convertUnitMethod · 0.45
handleMethod · 0.45
applyGravityMethod · 0.45
convertUnitToCorpseMethod · 0.45

Calls 2

getMovementTypeMethod · 0.80
getArmorMethod · 0.45

Tested by

no test coverage detected