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

Replace token IDs on imported maps #4791

Merged

Conversation

kwvanderlinde
Copy link
Collaborator

@kwvanderlinde kwvanderlinde commented May 23, 2024

Identify the Bug or Feature request

Fixes #4789

Description of the Change

Zones are now copied on import. This has the effect of regenerating all IDs (the zone itself, drawings, tokens). This also reduces the expectations on Zone#import() as the copy constructor will take of anything that isn't destroying data.

Possible Drawbacks

Imported maps can no longer be relied on to keep token IDs. Any maps that contain internal references to specific token IDs will no longer work as they did before and will have to be manually updated.

Documentation Notes

Token IDs cannot be relied on when importing maps since they will be changed to unique values.

Release Notes

  • Fixed a bug where token IDs of imported maps would not be updated, causing duplicate IDs.

This change is Reviewable

The copy constructor already guarantees that everything has independent copies made - and if it missed something that
would be a bug. So it's appealing to use it for map imports where we want the same thing. Also preserve the creation
time in the copy constructor when `keepIds` so that it is preserved when campaigns are copied and such.

`Zone#import()` no longer needs to do as much. All it does not is clear the initiative list.
ZoneRenderers are not actually being compared based on the creation time. If they were at some point, they aren't
anymore. No more need for ZoneRenderer to implement `Comparable<>`.
@kwvanderlinde kwvanderlinde self-assigned this May 23, 2024
@kwvanderlinde kwvanderlinde marked this pull request as ready for review May 23, 2024 05:50
@cwisniew cwisniew added this pull request to the merge queue May 23, 2024
Merged via the queue into RPTools:develop with commit 50db900 May 23, 2024
5 checks passed
@kwvanderlinde kwvanderlinde deleted the bugfix/4789-duplicate-token-IDs branch May 23, 2024 14:14
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Merged
Development

Successfully merging this pull request may close these issues.

[Bug]: Importing an existing map results in duplicate token IDs
2 participants