* Sets _unit in order to abuse low-level pathfinding functions from outside the class. * @param unit Unit taking the path. */
| 1146 | * @param unit Unit taking the path. |
| 1147 | */ |
| 1148 | void 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. |
no test coverage detected