From 650dc3dab8f4a66d690539c8b59d4b1d7980cab2 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Fri, 16 Nov 2012 20:11:28 +0400 Subject: [PATCH] Changed way CPR lock works, no dependancy on world time.stored time now. When someone starts doing CPR, it locks. After 3 ticks after CPR is done it unlocks. No other mobs can do CPR on same mob while it is locked. ((also it's one of places that can make CPR not start so I wanted ot replace timer with more simple semaphore)) --- code/modules/mob/living/carbon/human/inventory.dm | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index e220b673744..d5dec03baaf 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -433,8 +433,9 @@ return message = "\red [source] is trying to empty [target]'s pockets." if("CPR") - if (target.cpr_time >= world.time + 3) + if (!target.cpr_time) del(src) + target.cpr_time = 0 message = "\red [source] is trying perform CPR on [target]!" if("id") message = "\red [source] is trying to take off [target.wear_id] from [target]'s uniform!" @@ -540,10 +541,7 @@ It can still be worn/put on as normal. if (target.legcuffed) strip_item = target.legcuffed if("CPR") - if (target.cpr_time >= world.time + 30) - del(src) if ((target.health >= -99.0 && target.health <= 0)) - target.cpr_time = world.time var/suff = min(target.getOxyLoss(), 7) target.adjustOxyLoss(-suff) target.updatehealth() @@ -551,6 +549,8 @@ It can still be worn/put on as normal. O.show_message("\red [source] performs CPR on [target]!", 1) target << "\blue You feel a breath of fresh air enter your lungs. It feels good." source << "\red Repeat at least every 7 seconds." + spawn(3) + target.cpr_time = 1 if("dnainjector") var/obj/item/weapon/dnainjector/S = item if(S)