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

Pathfinder update despawner #1343

Merged
merged 4 commits into from
Feb 1, 2022
Merged

Pathfinder update despawner #1343

merged 4 commits into from
Feb 1, 2022

Conversation

originalfoo
Copy link
Member

Fixes: #485

This adds ability to define and check pathfinder "edition" used for a savegame and, if necessary, despawn specific categories of vehicle that might have bad paths due to bugs in earlier versions of pathfinder.

The first use of this is TM:PE 11.6.4.4 which fixed a pathfinder bug affecting planes; so despawn planes when a save using older pathfinder is loaded.

  • Add new byte option: Options.SavegamePathfinderEdition
    • Value defaults to 0 (unknown edition; ie. older savegame before this PR was added)
  • Add PathfinderUpdates class to manage the version check
    • LatestPathfinderEdition needs updating when necessary
    • If save edition != latest edition:
      • Add relevant ExtVehicleType flags to filter as applicable
      • Despawn everything matching filter (see Filtered despawn #1341 for how that works)
      • Update Options.SavegamePathfinderEdition = LatestPathfinderEdition
  • In TMPELifecycle.Load() trigger the process (in PlayMode only)
    • If something despawned, show message to let user know

`SavegamePathfinderEdition` defaults to `0`
- Checks if savegame edition != latest edition
- If so, works out what to despawn
- Then despawns it (see #1341 for how that works)
Shows a message telling user what was despawned,
if applicable.
@originalfoo originalfoo added UI User interface updates PATHFINDER Pathfinding tweaks or issues lifecycle related to the loading process like enabling/disabling/loading/reloading/load order/hot reload Vehicle Behavior Vehicle behavior related issue labels Feb 1, 2022
@originalfoo originalfoo added this to the 11.6.4-hotfix-4 milestone Feb 1, 2022
@originalfoo originalfoo self-assigned this Feb 1, 2022
Copy link
Member

@krzychu124 krzychu124 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Works in game 👍

@originalfoo
Copy link
Member Author

Ok, this one is mergeable then I'll fix the merge conflict that will occur on #1339 and then it's ready for release :)

@krzychu124 krzychu124 merged commit 61b6240 into master Feb 1, 2022
@krzychu124 krzychu124 deleted the pathfinder-update-despawner branch February 1, 2022 22:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lifecycle related to the loading process like enabling/disabling/loading/reloading/load order/hot reload PATHFINDER Pathfinding tweaks or issues UI User interface updates Vehicle Behavior Vehicle behavior related issue
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Version the pathfinder (preferably automatically) and clear traffic if it changes
2 participants