mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-21 11:07:12 +01:00
Fixes countdowns being out of movement sync with their atom (#20219)
* countdowns move when their attached atom moves * fallback
This commit is contained in:
@@ -17,6 +17,7 @@
|
||||
/obj/effect/countdown/Initialize(mapload)
|
||||
. = ..()
|
||||
attach(loc)
|
||||
RegisterSignal(attached_to, COMSIG_MOVABLE_MOVED, PROC_REF(countdown_on_move))
|
||||
|
||||
/obj/effect/countdown/examine(mob/user)
|
||||
. = ..()
|
||||
@@ -37,14 +38,19 @@
|
||||
STOP_PROCESSING(SSfastprocess, src)
|
||||
started = FALSE
|
||||
|
||||
/// Get the value from our atom
|
||||
/obj/effect/countdown/proc/get_value()
|
||||
// Get the value from our atom
|
||||
return
|
||||
|
||||
/obj/effect/countdown/proc/countdown_on_move()
|
||||
SIGNAL_HANDLER
|
||||
forceMove(get_turf(attached_to))
|
||||
|
||||
/obj/effect/countdown/process()
|
||||
if(!attached_to || QDELETED(attached_to))
|
||||
qdel(src)
|
||||
forceMove(get_turf(attached_to))
|
||||
if(!isturf(attached_to.loc)) // When in crates, lockers, etc. countdown_on_move wont be called. This is our backup
|
||||
forceMove(get_turf(attached_to))
|
||||
var/new_val = get_value()
|
||||
if(new_val == displayed_text)
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user