mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-18 21:15:21 +00:00
* Fixes crashing through tables from a table giving you a negative offset (#80701) ## About The Pull Request While failing to reproduce #80675, given no amount of slamming this poor little moth creature through glass tables in any order and then rebuilding it under them seemed to be doing anything, I found that it _does_ cause a negative offset if the moth-to-be-slammed in question was already on a table before being slammed into a glass table. (Don't worry they have health insurance.) After some debugging, this seemed to be because `Detach()` is called for the new turf with the smashed table _before_ `on_exited()` is called for the previous turf, causing it to first reduce one's offset by 12, and then reduce it by 12 _again_ upon calling `on_exited()`. This seemed to be true for whichever method was used, whether walking, dragging, or being smashed.  So I introduced the same check for `TRAIT_ON_ELEVATED_SURFACE` that `Detach()` has to `on_exited()`, making it only attempt to shift down the movable if it still has the trait, and this seems to fix it fine! It doesn't seem to cause issues with moving from beds onto tables or tables onto beds, or smashing through glass tables from tables or beds. So this should fix #80675, or at least I can't find what they would've meant if not this. And yes I did test this on Tramstation just in case.  ## Why It's Good For The Game Fixes #80675. ## Changelog 🆑 fix: slamming through a glass table while previously on a table no longer gives you a negative offset. /🆑 * Fixes crashing through tables from a table giving you a negative offset --------- Co-authored-by: _0Steven <42909981+00-Steven@users.noreply.github.com>