From b6905e666815aab3e482a708204c9473be765340 Mon Sep 17 00:00:00 2001 From: Jeremy Liberman Date: Sun, 2 Mar 2014 15:08:55 -0600 Subject: [PATCH] Fixes UI glitch when losing cuffs from fractures, resisting, or cult magic Conflicts: code/modules/mob/living/living.dm --- code/game/gamemodes/cult/runes.dm | 8 ++------ code/modules/mob/living/living.dm | 23 +++++++++++++++++------ code/modules/organs/organ_external.dm | 8 ++------ 3 files changed, 21 insertions(+), 18 deletions(-) diff --git a/code/game/gamemodes/cult/runes.dm b/code/game/gamemodes/cult/runes.dm index f8c6c3e1810..e08df1a893e 100644 --- a/code/game/gamemodes/cult/runes.dm +++ b/code/game/gamemodes/cult/runes.dm @@ -775,13 +775,9 @@ var/list/sacrificed = list() return cultist.buckled = null if (cultist.handcuffed) - cultist.handcuffed.loc = cultist.loc - cultist.handcuffed = null - cultist.update_inv_handcuffed() + cultist.drop_from_inventory(cultist.handcuffed) if (cultist.legcuffed) - cultist.legcuffed.loc = cultist.loc - cultist.legcuffed = null - cultist.update_inv_legcuffed() + cultist.drop_from_inventory(cultist.legcuffed) if (istype(cultist.wear_mask, /obj/item/clothing/mask/muzzle)) cultist.u_equip(cultist.wear_mask) if(istype(cultist.loc, /obj/structure/closet)&&cultist.loc:welded) diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm index c346dc9db7d..e22fb6b8d5f 100644 --- a/code/modules/mob/living/living.dm +++ b/code/modules/mob/living/living.dm @@ -272,6 +272,22 @@ src.updatehealth() /mob/living/proc/revive() + rejuvenate() + buckled = initial(src.buckled) + if(iscarbon(src)) + var/mob/living/carbon/C = src + + if (C.handcuffed && !initial(C.handcuffed)) + C.drop_from_inventory(C.handcuffed) + C.handcuffed = initial(C.handcuffed) + + if (C.legcuffed && !initial(C.legcuffed)) + C.drop_from_inventory(C.legcuffed) + C.legcuffed = initial(C.legcuffed) + +/mob/living/proc/rejuvenate() + + // shut down various types of badness setToxLoss(0) setOxyLoss(0) setCloneLoss(0) @@ -624,8 +640,6 @@ O.show_message("\red [CM] manages to remove the handcuffs!", 1) CM << "\blue You successfully remove \the [CM.handcuffed]." CM.drop_from_inventory(CM.handcuffed) - CM.handcuffed = null - CM.update_inv_handcuffed() else if(CM.legcuffed && CM.canmove && (CM.last_special <= world.time)) CM.next_move = world.time + 100 @@ -664,7 +678,4 @@ CM << "\blue You successfully remove \the [CM.legcuffed]." CM.drop_from_inventory(CM.legcuffed) CM.legcuffed = null - CM.update_inv_legcuffed() - - - + CM.update_inv_legcuffed() \ No newline at end of file diff --git a/code/modules/organs/organ_external.dm b/code/modules/organs/organ_external.dm index 25afdd460b2..89de26db15b 100644 --- a/code/modules/organs/organ_external.dm +++ b/code/modules/organs/organ_external.dm @@ -613,18 +613,14 @@ This function completely restores a damaged organ to perfect condition. "\The [owner.handcuffed.name] falls off of [owner.name].",\ "\The [owner.handcuffed.name] falls off you.") - owner.handcuffed.loc = owner.loc - owner.handcuffed = null - owner.update_inv_handcuffed() + owner.drop_from_inventory(owner.handcuffed) if (owner.legcuffed && body_part in list(FOOT_LEFT, FOOT_RIGHT, LEG_LEFT, LEG_RIGHT)) owner.visible_message(\ "\The [owner.legcuffed.name] falls off of [owner.name].",\ "\The [owner.legcuffed.name] falls off you.") - owner.legcuffed.loc = owner.loc - owner.legcuffed = null - owner.update_inv_legcuffed() + owner.drop_from_inventory(owner.legcuffed) /datum/organ/external/proc/bandage() var/rval = 0