FIXES RUNTIME EVERYTIME A PAI MOVES (#69054)

Fixes runtime on movement if a pai fails to put the hacking cable in its holder's hands
This commit is contained in:
ShizCalev
2022-08-08 23:11:10 +12:00
committed by GitHub
parent 06cd9086eb
commit 259aeff063
3 changed files with 5 additions and 5 deletions
+1 -4
View File
@@ -36,7 +36,7 @@
QDEL_NULL(hacking_cable) //clear any old cables
hacking_cable = new
var/mob/living/carbon/hacker = get_holder()
if(hacker?.put_in_hands(hacking_cable))
if(iscarbon(hacker) && hacker.put_in_hands(hacking_cable)) //important to double check since get_holder can return non-null values that aren't carbons.
hacker.visible_message(span_notice("A port on [src] opens to reveal a cable, which you quickly grab."), span_hear("You hear the soft click of a plastic component and manage to catch the falling cable."))
track_pai()
track_thing(hacking_cable)
@@ -90,10 +90,7 @@
/mob/living/silicon/pai/proc/retract_cable()
hacking_cable.visible_message(span_notice("The cable quickly retracts."))
balloon_alert(src, "cable retracted")
untrack_pai()
untrack_thing(hacking_cable)
QDEL_NULL(hacking_cable)
SStgui.update_user_uis(src)
return TRUE
/**
+3
View File
@@ -183,7 +183,10 @@
/mob/living/silicon/pai/handle_atom_del(atom/deleting_atom)
if(deleting_atom == hacking_cable)
untrack_pai()
untrack_thing(hacking_cable)
hacking_cable = null
SStgui.update_user_uis(src)
if(!QDELETED(card))
card.update_appearance()
if(deleting_atom == atmos_analyzer)
+1 -1
View File
@@ -157,7 +157,7 @@
to_chat(src, span_syndradio("You are not at liberty to do this! All agents are clandestine."))
return FALSE
var/mob/living/carbon/holder = get_holder()
if(!holder)
if(!iscarbon(holder))
balloon_alert(src, "not being carried")
return FALSE
balloon_alert(src, "requesting DNA sample")