Stop portable machines updating their icon every atmos tick #27941
+33
−61
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.
What Does This PR Do
This PR makes it so that portable atmos machines, notably canisters, spend less time in SSair updating their icons and checking to see whether they should update their icons. Despite all the bookkeeping and flag updating here, update_icon was still getting called and executing countless times, to the tune of 3.5 million times a round:
This removes all that and just calls update_icon when it needs to be called, when we know the appearance needs changing:
Why It's Good For The Game
Performance.
Images of changes
Before
After
Testing
Attached canisters to ports, unattached, added tank to canister, removed tank, opened valve, watched light as pressure changed, modified canister paint job.
Declaration
Changelog
NPFC