Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

If a vehicle ends up with a GotoLocation mission to an unreachable ti… #1

Merged
merged 1 commit into from May 12, 2019

Conversation

Atrosha
Copy link
Owner

@Atrosha Atrosha commented May 12, 2019

…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. (OpenApoc#563)

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:

Run clang-format

Run clang-format 4.0.0, which is the version used by Travis CI.

…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. (#563)

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.
@Atrosha Atrosha merged commit a353929 into Atrosha:master May 12, 2019
Atrosha pushed a commit that referenced this pull request Aug 21, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants