better way for that (#9080)

This commit is contained in:
Kashargul
2024-09-29 08:44:07 +02:00
committed by GitHub
parent d45c297d50
commit a7ebbadb5e

View File

@@ -7,11 +7,10 @@
/obj/item/weapon/card/id/exploration/borg/Initialize()
. = ..()
if(loc)
if(isrobot(loc?.loc))
R = loc.loc
if(istype(R))
registered_name = R.braintype
RegisterSignal(src, COMSIG_OBSERVER_MOVED, PROC_REF(check_loc))
registered_name = R.braintype
RegisterSignal(src, COMSIG_OBSERVER_MOVED, PROC_REF(check_loc))
/obj/item/weapon/card/id/exploration/borg/proc/check_loc(atom/movable/mover, atom/old_loc, atom/new_loc)
if(old_loc == R || old_loc == R.module)
@@ -26,5 +25,8 @@
hud_layerise()
/obj/item/weapon/card/id/exploration/borg/Destroy()
UnregisterSignal(src, COMSIG_OBSERVER_MOVED)
if(R)
UnregisterSignal(src, COMSIG_OBSERVER_MOVED)
R = null
last_robot_loc = null
..()