Refactored movement observable away (#20083)

Refactored movement observable away, use only the signal.
Some tweaks to the signal.
This commit is contained in:
Fluffy
2024-10-26 15:53:07 +00:00
committed by GitHub
parent 3de4911dc8
commit d40d459d42
35 changed files with 532 additions and 434 deletions
+4 -4
View File
@@ -52,9 +52,9 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
user.reset_view(linked)
if(user.client)
user.client.view = world.view + extra_view
GLOB.moved_event.register(user, src, PROC_REF(unlook))
RegisterSignal(user, COMSIG_MOVABLE_MOVED, PROC_REF(unlook))
if(user.eyeobj)
GLOB.moved_event.register(user.eyeobj, src, PROC_REF(unlook))
RegisterSignal(user, COMSIG_MOVABLE_MOVED, PROC_REF(unlook))
LAZYDISTINCTADD(viewers, WEAKREF(user))
if(linked)
LAZYDISTINCTADD(linked.navigation_viewers, WEAKREF(user))
@@ -80,11 +80,11 @@ somewhere on that shuttle. Subtypes of these can be then used to perform ship ov
c.pixel_x = 0
c.pixel_y = 0
GLOB.moved_event.unregister(user, src, PROC_REF(unlook))
UnregisterSignal(user, COMSIG_MOVABLE_MOVED)
if(isEye(user)) // If we're an AI eye, the computer has our AI mob in its viewers list not the eye mob
var/mob/abstract/eye/E = user
GLOB.moved_event.unregister(E.owner, src, PROC_REF(unlook))
UnregisterSignal(E.owner, COMSIG_MOVABLE_MOVED)
LAZYREMOVE(viewers, WEAKREF(E.owner))
LAZYREMOVE(viewers, WEAKREF(user))
if(linked)