Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
If a vehicle ends up with a GotoLocation mission to an unreachable ti…
…le, it will repeatedly try to find a path in every game tick. The vehicle will eventually get stuck and slow down the game by spamming pathfinding requests. Note that vehicles usually don't end up with a GotoLocation with an unreachable destination, but it's possible, i.e. if some road tiles on the way get destroyed after the mission is created. Other fixes: * Prevent a vehicle from side-stepping in order to avoid itself. Implementation notes: * Moved all adjustTarget* methods to a new class VehicleTargetHelper with a single method that dispatches based on vehicle type. * Note that it's now that caller's responsibility to set pickedNearest as needed. * Inverted some conditionals for clearer early returns. Manually verified these vehicles are un-stuck after this change: * #395 (comment) * #395 (comment) Run clang-format Run clang-format 4.0.0, which is the version used by Travis CI.
- Loading branch information