From d900b52a331f7519e14cfecb9ba0eac6611f7a3d Mon Sep 17 00:00:00 2001 From: Neerti Date: Tue, 9 May 2017 20:14:04 -0400 Subject: [PATCH] Defib Fixes Fixes runtime when screwdrivering the defib to remove the powercell. Husked people can no longer be revived. This is because otherwise they could become alive again but remain husked. --- code/game/objects/items/devices/defib.dm | 19 ++++++++++--------- 1 file changed, 10 insertions(+), 9 deletions(-) diff --git a/code/game/objects/items/devices/defib.dm b/code/game/objects/items/devices/defib.dm index 73efffe121..8b048a035e 100644 --- a/code/game/objects/items/devices/defib.dm +++ b/code/game/objects/items/devices/defib.dm @@ -75,7 +75,7 @@ if(user.r_hand && user.l_hand) cell.forceMove(get_turf(user)) else - cell.forceMove(user.put_in_hands(cell)) + user.put_in_hands(cell) cell = null playsound(src.loc, 'sound/items/Screwdriver.ogg', 50, 1) else @@ -141,14 +141,15 @@ sleep(15 SECONDS) break - if(patient.client) - patient.adjustOxyLoss(-20) //Look, blood stays oxygenated for quite some time, but I'm not recoding the entire oxy system - patient.stat = CONSCIOUS //Note that if whatever killed them in the first place wasn't fixed, they're likely to die again. - dead_mob_list -= patient - living_mob_list += patient - patient.timeofdeath = null - patient.visible_message("[patient]'s eyes open!") - log_and_message_admins("[patient] was revived.") + if(!(HUSK in patient.mutations)) // Husked people can't come back with a Defib. + if(patient.client) + patient.adjustOxyLoss(-20) //Look, blood stays oxygenated for quite some time, but I'm not recoding the entire oxy system + patient.stat = CONSCIOUS //Note that if whatever killed them in the first place wasn't fixed, they're likely to die again. + dead_mob_list -= patient + living_mob_list += patient + patient.timeofdeath = null + patient.visible_message("[patient]'s eyes open!") + log_and_message_admins("[patient] was revived by a defib.") cell.charge -= charge_cost //Always charge the cost after any attempt, failed or not sleep(20) //Wait 2 seconds before next attempt statechange(1,patient) //Back to ready