[MIRROR] Fix table top deconstruction #2815
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#1880
Original PR: tgstation/tgstation#82508
About The Pull Request
Edited: updated changelog, read comments for changes in implementation details
So previously, tables would let you use a wrench to fully deconstruct them, or a screwdriver to take off only their top.
This, however, broke in two different ways in #82280, when their deconstruction logic got changed.
First off, deconstructed tables would only drop the materials for their top and not their frame.
For this, the primary culprit seems to be on line 307:
https://github.com/tgstation/tgstation/blob/c34d56a45b0461f5e0fad3cc75e81580c3357119/code/game/objects/structures/tables_racks.dm#L300-L307
Where
new framestack(target_turf, framestackamount)
accidentally got an extra indent, and ended up in the less common half of the if-else chain.Just moving this outside of the if-else chain again fixes it.
Secondly, tables had their own special deconstruction logic, which got 'standardized'.
Issue. This was special to accommodate for having two different deconstruction logics: full or top only.
With
deconstruct(...)
no longer being overridable, I feel it's awkward to attempt to proxy that information to the newatom_deconstruct(...)
So we introduce a new method,
deconstruct_top
, for the screwdriver to use, which handles deconstructing only the top.Mimicking the
NO_DECONSTRUCTION
logic of normal deconstruction, and copying over the flag onto its frames if need be.This fixes screwdriver deconstruction.
Why It's Good For The Game
Fixes #82503.
We can now deconstruct the table top separately again, AND get the right materials back too.
Changelog
🆑 00-Steven, SyncIt21
fix: Wrench table deconstruction gives the right materials again.
fix: Screwdriver table deconstruction only deconstructs the top again.
/:cl: