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
@@ -68,7 +68,7 @@
/obj/item/storage/slide_projector/proc/stop_projecting()
if(projection)
QDEL_NULL(projection)
GLOB.moved_event.unregister(src, src, PROC_REF(check_projections))
UnregisterSignal(src, COMSIG_MOVABLE_MOVED)
set_light(0)
update_icon()
@@ -83,7 +83,7 @@
break
projection = new projection_type(target)
projection.set_source(current_slide)
GLOB.moved_event.register(src, src, PROC_REF(check_projections))
RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(check_projections))
set_light(1.4, 0.1, COLOR_WHITE) //Bit of light
update_icon()
+2 -2
View File
@@ -9,12 +9,12 @@
/obj/structure/easel/Initialize(ml, _mat, _reinf_mat)
. = ..()
GLOB.moved_event.register(src, src, PROC_REF(move_painting))
RegisterSignal(src, COMSIG_MOVABLE_MOVED, PROC_REF(move_painting))
material = SSmaterials.get_material_by_name(MATERIAL_WOOD)
/obj/structure/easel/Destroy()
painting = null
GLOB.moved_event.unregister(src, src, PROC_REF(move_painting))
UnregisterSignal(src, COMSIG_MOVABLE_MOVED)
return ..()
/*
@@ -43,8 +43,6 @@
T.pixel_x = 0
T.pixel_y = 0
T.layer = ABOVE_OBJ_LAYER
GLOB.moved_event.register(T, src, TYPE_PROC_REF(/atom/movable, move_to_turf))
GLOB.moved_event.register(src, T, TYPE_PROC_REF(/atom/movable, move_to_turf))
T.stake = src
pinned_target = T
else
@@ -52,8 +50,6 @@
if(pinned_target)
pinned_target.density = FALSE
pinned_target.layer = OBJ_LAYER
GLOB.moved_event.unregister(pinned_target, src)
GLOB.moved_event.unregister(src, pinned_target)
pinned_target.stake = null
pinned_target = null