Remove recursivemove + signals from being on EVERY machine by default (#7992)

This commit is contained in:
Raeschen
2024-03-19 21:02:06 +01:00
committed by GitHub
parent 580a27f1ad
commit 7dbb3ba53c

View File

@@ -70,11 +70,20 @@
return amount // If channel is powered then you can do it.
return 0
/obj/machinery
var/recursive_set = FALSE //CHOMPEdit: bool to indicate if recursive movement detection ever got set. If it did, don't try to set it again!
// Do not do power stuff in New/Initialize until after ..()
/obj/machinery/Initialize()
. = ..()
RegisterSignal(src, COMSIG_OBSERVER_MOVED, PROC_REF(update_power_on_move))
AddComponent(/datum/component/recursive_move)
//ChompEDIT START -- only add this if we init on a non-turf (and non-null)
if(loc && !isturf(loc))
recursive_set = TRUE
AddComponent(/datum/component/recursive_move)
RegisterSignal(src, COMSIG_OBSERVER_MOVED, PROC_REF(update_power_on_move)) //we only need this for recursive moving
//ChompEDIT END
var/power = POWER_CONSUMPTION
REPORT_POWER_CONSUMPTION_CHANGE(0, power)
power_init_complete = TRUE
@@ -94,6 +103,14 @@
/obj/machinery/Moved(atom/old_loc, direction, forced = FALSE)
. = ..()
update_power_on_move(src, old_loc, loc)
//ChompEDIT START -- only add this if we move into a non-turf (not null) and we've never been given recursive move handling
if(!recursive_set && loc && !isturf(loc))
recursive_set = TRUE
AddComponent(/datum/component/recursive_move)
RegisterSignal(src, COMSIG_OBSERVER_MOVED, PROC_REF(update_power_on_move)) //we only need this for recursive moving
//ChompEDIT END
/* No
if(ismovable(old_loc)) // Unregister recursive movement.
UnregisterSignal(old_loc, COMSIG_OBSERVER_MOVED)