[MIRROR] Fix issues resulting from an elevated object being created inside of a non-turf atom (#27890)

* Fix issues resulting from an elevated object being created inside of a non-turf atom (#83498)

## About The Pull Request

If an elevated object is initialized inside of a non-turf atom, it'll
still make the turf it is on elevated. Permanently. Which is weird.

## Why It's Good For The Game

Randomly elevated turfs are bad. Bugs bad.

## Changelog
🆑
fix: Fix a rare issue where a turf would remain permanently "elevated"
if an elevated object was initialized inside of a non-turf object.
/🆑

* Fix issues resulting from an elevated object being created inside of a non-turf atom

---------

Co-authored-by: Lucy <lucy@absolucy.moe>
This commit is contained in:
SkyratBot
2024-05-29 02:05:14 +02:00
committed by GitHub
co-authored by Lucy
parent d96e893d28
commit df1266e4de
+3 -2
View File
@@ -18,8 +18,9 @@
if(ismovable(target))
RegisterSignal(target, COMSIG_MOVABLE_MOVED, PROC_REF(on_moved))
var/turf/turf = get_turf(target)
if(turf)
var/atom/atom_target = target
if(isturf(atom_target.loc))
var/turf/turf = atom_target.loc
if(!HAS_TRAIT(turf, TRAIT_TURF_HAS_ELEVATED_OBJ(pixel_shift)))
RegisterSignal(turf, COMSIG_TURF_RESET_ELEVATION, PROC_REF(check_elevation))
RegisterSignal(turf, COMSIG_TURF_CHANGE, PROC_REF(pre_change_turf))