Signal fixes (#18923)

* Fixes these signals

* unscrungles remote view
This commit is contained in:
Cameron Lennox
2025-12-20 03:23:16 -05:00
committed by GitHub
parent ab92f569b4
commit dcdd46fb17
31 changed files with 72 additions and 72 deletions
@@ -15,7 +15,7 @@
// Mob
host_mob = parent
RegisterSignal(host_mob, COMSIG_LIVING_LIFE, PROC_REF(on_mob_action))
RegisterSignal(host_mob, COMSIG_MOVABLE_MOVED, PROC_REF(on_mob_action))
RegisterSignal(host_mob, COMSIG_MOVABLE_ATTEMPTED_MOVE, PROC_REF(on_mob_action))
RegisterSignal(host_mob, COMSIG_MOB_LOGOUT, PROC_REF(on_mob_logout))
// Machine
@@ -34,7 +34,7 @@
linked_machine.in_use = FALSE
linked_machine = null
// Mob
UnregisterSignal(host_mob, COMSIG_MOVABLE_MOVED)
UnregisterSignal(host_mob, COMSIG_MOVABLE_ATTEMPTED_MOVE)
UnregisterSignal(host_mob, COMSIG_LIVING_LIFE)
UnregisterSignal(host_mob, COMSIG_MOB_LOGOUT)
host_mob.reset_perspective() // Required, because our machine may have been operating a remote view
+3 -3
View File
@@ -83,12 +83,12 @@
//Parent at top of heirarchy moved.
/datum/component/recursive_move/proc/top_moved(var/atom/movable/am, var/atom/new_loc, var/atom/old_loc)
SIGNAL_HANDLER
SEND_SIGNAL(holder, COMSIG_MOVABLE_MOVED, old_loc, new_loc)
SEND_SIGNAL(holder, COMSIG_MOVABLE_ATTEMPTED_MOVE, old_loc, new_loc)
//One of the parents other than the top parent moved.
/datum/component/recursive_move/proc/heirarchy_changed(var/atom/old_loc, var/atom/movable/am, var/atom/new_loc)
SIGNAL_HANDLER
SEND_SIGNAL(holder, COMSIG_MOVABLE_MOVED, old_loc, new_loc)
SEND_SIGNAL(holder, COMSIG_MOVABLE_ATTEMPTED_MOVE, old_loc, new_loc)
//Rebuild our list of parents
reset_parents()
setup_parents()
@@ -130,4 +130,4 @@
/obj/item/bananapeel/test/Initialize(mapload)
. = ..()
AddComponent(/datum/component/recursive_move)
RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(shmove))
RegisterSignal(src, COMSIG_MOVABLE_ATTEMPTED_MOVE, PROC_REF(shmove))
+4 -4
View File
@@ -53,7 +53,7 @@
RegisterSignal(host_mob, COMSIG_MOB_HANDLE_HUD_DARKSIGHT, PROC_REF(handle_hud_darkvision))
// Recursive move component fires this, we only want it to handle stuff like being inside a paicard when releasing turf lock
if(isturf(focused_on))
RegisterSignal(host_mob, COMSIG_MOVABLE_MOVED, PROC_REF(handle_recursive_moved))
RegisterSignal(host_mob, COMSIG_MOVABLE_ATTEMPTED_MOVE, PROC_REF(handle_recursive_moved))
// Focus on remote view
remote_view_target = focused_on
if(host_mob != remote_view_target) // Some items just offset our view, so we set ourselves as the view target, don't double dip if so!
@@ -88,7 +88,7 @@
if(settings.will_blind)
UnregisterSignal(host_mob, COMSIG_LIVING_STATUS_BLIND)
if(isturf(remote_view_target))
UnregisterSignal(host_mob, COMSIG_MOVABLE_MOVED)
UnregisterSignal(host_mob, COMSIG_MOVABLE_ATTEMPTED_MOVE)
if(settings.will_death)
UnregisterSignal(host_mob, COMSIG_MOB_DEATH)
// Handle relayed movement
@@ -419,13 +419,13 @@
. = ..()
// Items can be nested deeply, so we need to update on any parent reorganization or actual move.
host_mob.AddComponent(/datum/component/recursive_move)
RegisterSignal(host_mob, COMSIG_MOVABLE_MOVED, PROC_REF(handle_recursive_moved)) // Doesn't need override, basetype only ever registers this signal if we're looking at a turf
RegisterSignal(host_mob, COMSIG_MOVABLE_ATTEMPTED_MOVE, PROC_REF(handle_recursive_moved)) // Doesn't need override, basetype only ever registers this signal if we're looking at a turf
// Check our inmob state
if(ismob(find_topmost_atom()))
needs_to_decouple = TRUE
/datum/component/remote_view/mob_holding_item/Destroy(force)
UnregisterSignal(host_mob, COMSIG_MOVABLE_MOVED)
UnregisterSignal(host_mob, COMSIG_MOVABLE_ATTEMPTED_MOVE)
. = ..()
/datum/component/remote_view/mob_holding_item/handle_status_effects(datum/source, amount, ignore_canstun)