mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 10:12:45 +00:00
better way for that (#9080)
This commit is contained in:
@@ -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
|
||||
..()
|
||||
|
||||
Reference in New Issue
Block a user