[MIRROR] Machinery Destroy() side effect clean up #2911
Merged
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.
Mirrored on Nova: NovaSector/NovaSector#2011
Original PR: tgstation/tgstation#82659
About The Pull Request
I have combed over implementations of
Destroy()
forobj/machinery
, and noticed quite a few was spawning items or playing sounds.Slot machines:
Moved payout to on_deconstruction()
Windoors:
Break sound moved to on_deconstruction().
I have also slightly cleaned up Destroy(), the windoor calls air_update_turf directly, as that proc already retrieves the turf it is on.
Atmospheric pipe:
Releases air and deconstructs meter objects on_deconstruction().
Portable atmospheric devices:
Drop hyper noblium crystal on on_destruction().
Pump, Scrubbers:
Releases air on_deconstruction().
PACMAN power generator:
Spawns dropped fuel on_deconstruction().
Runic vendor:
Moved vanishing effects to on_deconstruction().
I did not change Destroy side effects in the following instances:
Out of 220 Destroy defines, I found only 8 side effects that could not be moved to other procs, so
machinery\Destroy()
has almost always been used properly! I really hopestructure
will be as well made.Other changes:
Why It's Good For The Game
The Destroy() proc should only contain reference clean ups, barring edge cases that would harm playability.
Changelog
Nothing player facing.