fix robot ids (#19332)

This commit is contained in:
Kashargul
2026-03-22 19:45:18 +01:00
committed by GitHub
parent 804395b47e
commit ca9b4483f8
@@ -272,32 +272,32 @@
return
/obj/item/card/id/synthetic/borg
var/mob/living/silicon/robot/R
var/mob/living/silicon/robot/robot_owner
var/last_robot_loc
/obj/item/card/id/synthetic/borg/Initialize(mapload)
. = ..()
if(isrobot(loc?.loc))
R = loc.loc
registered_name = R.braintype
if(isrobot(loc))
robot_owner = loc
registered_name = robot_owner.braintype
RegisterSignal(src, COMSIG_MOVABLE_ATTEMPTED_MOVE, PROC_REF(check_loc))
/obj/item/card/id/synthetic/borg/proc/check_loc(atom/movable/mover, atom/old_loc, atom/new_loc)
SIGNAL_HANDLER
if(old_loc == R || old_loc == R.module)
if(old_loc == robot_owner || old_loc == robot_owner.module)
last_robot_loc = old_loc
if(!istype(loc, /obj/machinery) && loc != R && loc != R.module)
if(!istype(loc, /obj/machinery) && loc != robot_owner && loc != robot_owner.module)
if(last_robot_loc)
forceMove(last_robot_loc)
last_robot_loc = null
else
forceMove(R)
if(loc == R)
forceMove(robot_owner)
if(loc == robot_owner)
hud_layerise()
/obj/item/card/id/synthetic/borg/Destroy()
if(R)
if(robot_owner)
UnregisterSignal(src, COMSIG_MOVABLE_ATTEMPTED_MOVE)
R = null
robot_owner = null
last_robot_loc = null
. = ..()