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

Fix Map Post Processing applies every reload #79584

Closed

Conversation

QuillInkwell
Copy link
Contributor

@QuillInkwell QuillInkwell commented Feb 7, 2025

Summary

Bugfixes "Fix Map Post Processing applies every reload"

Purpose of change

Fix #79565. Stop maps from running the post processing every single time the game reloads.

Describe the solution

Create a flag to determine if post processing should be applied. Set the flag only when the map is first drawn. This should stop post processing from applying every time the function is run.

It seems maps are evaluated with the generate command multiple times. Special checks are performed to only draw the map once though. So we apply the flag there.

It's not possible to apply post processing at that time though. Just based on how the post processor is written it needs the map to be finalized otherwise it completely breaks down.

Describe alternatives you've considered

I considered moving where the post processing happens to occur right after the map is drawn. But as I said just based on the processor is written it completely breaks everything. So I have left it at the bottom and used the flag based approach instead. It's called a post processor anyway so I don't think it's a huge issue to just wait for the map to be finalized before applying.

Testing

Created a world. Went to a location with riot damage. Reloaded multiple times. Confirmed the post processor is no longer being more than once.

Additional context

@github-actions github-actions bot added Map / Mapgen Overmap, Mapgen, Map extras, Map display [C++] Changes (can be) made in C++. Previously named `Code` <Bugfix> This is a fix for a bug (or closes open issue) astyled astyled PR, label is assigned by github actions json-styled JSON lint passed, label assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions labels Feb 7, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
astyled astyled PR, label is assigned by github actions BasicBuildPassed This PR builds correctly, label assigned by github actions <Bugfix> This is a fix for a bug (or closes open issue) [C++] Changes (can be) made in C++. Previously named `Code` json-styled JSON lint passed, label assigned by github actions Map / Mapgen Overmap, Mapgen, Map extras, Map display
Projects
None yet
Development

Successfully merging this pull request may close these issues.

"Implement riot damage in cities" is run again every single time a save is loaded
1 participant