Fix Map Post Processing applies every reload #79584
Closed
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.
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