Fix observer/move (Shields not following you) (#7856)

This commit is contained in:
Raeschen
2024-03-01 19:04:56 +01:00
committed by GitHub
parent b12f8927e2
commit 8ea4dc6a96
+6
View File
@@ -32,6 +32,12 @@ GLOBAL_DATUM_INIT(moved_event, /decl/observ/moved, new)
. = ..()
am.RegisterSignal(src,COMSIG_OBSERVER_MOVED, /atom/movable/proc/recursive_move, override = TRUE)
/atom/movable/Initialize(mapload)
. = ..()
if(istype(loc, /atom/movable)) // on initialise, if i'm inside a thing, preregister this.
var/atom/movable/am = loc
RegisterSignal(am, COMSIG_OBSERVER_MOVED, /atom/movable/proc/recursive_move, override = TRUE)
/atom/movable/Exited(var/atom/movable/am, atom/old_loc)
. = ..()
am.UnregisterSignal(src,COMSIG_OBSERVER_MOVED)