-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
Fix map memory edge case #37460
Merged
Merged
Fix map memory edge case #37460
Changes from 6 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
8bf6486
Fix map connections
Trioct 57c1a63
Fix more cache stuff
Trioct 00b8d67
Minor tweak
Trioct 817737e
Minor tweak
Trioct d4dd605
Factor out variable
Trioct 698303a
Replace auto with type
Trioct 07aaa42
Use alternative solution
Trioct 9df4d5d
Use suggested solution
Trioct File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
rotation
also affects appearance of tiles, so it should also be compared. Anyway, I think you can just memorize the tile without comparing it to the old value.Also I'm not sure if it fully fixes #36609. Could you test this case:
======
(what we want) or==><==
(what we had)?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Rotation does change the appearance of the tile, but I don't think rotation should be changed without resetting the cache at that index, whereas revealing more information about the map does change the subtile without telling the cache.
And I believe the tile needs to be compared to the old one because (as far as I can tell) only the top level "thing" is stored in map memory. Furniture, for example, could be overwritten by terrain, as only one can be remembered. So if something has been seen there, it can't be overwritten unless I know it's terrain.
An improvement I might actually be able to do is to just check if it's terrain and overwrite it.
Another option is to un-see the tiles being drawn before re-seeing them (so they are re-memorized), but I feel like this would remove the purpose of the map memory seen cache, if I'm thinking correctly.
And I had noticed that situation in the test would happen, but I would consider that a different bug. You can also fix the memory by just sweeping over the disconnections, and it'll fix it. I can't think of a convenient way to fix that bug.