From bf88ce8e5530668edad59d6883a91ecd978c821d Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Mon, 3 Feb 2020 23:27:07 +0100 Subject: [PATCH 1/2] Fixes straightjackets to buckle you forever --- code/modules/mob/living/carbon/carbon.dm | 10 ++++++---- code/modules/mob/living/carbon/human/human.dm | 11 ++++------- code/modules/mob/update_status.dm | 5 ++++- 3 files changed, 14 insertions(+), 12 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index af6bdb26af5..bc167910747 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -615,10 +615,12 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, return TRUE /mob/living/carbon/restrained() - if(handcuffed) + if(get_retraining_item()) return TRUE - return + return FALSE +/mob/living/carbon/get_retraining_item() + return handcuffed /mob/living/carbon/unEquip(obj/item/I, force) //THIS PROC DID NOT CALL ..() . = ..() //Sets the default return value to what the parent returns. @@ -773,8 +775,8 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, /mob/living/carbon/resist_buckle() spawn(0) resist_muzzle() - if(restrained()) - var/obj/item/I = handcuffed + var/obj/item/I + if((I = get_retraining_item())) // If there is nothing to restrain him then he is not restrained var/breakouttime = I.breakouttime var/displaytime = breakouttime / 10 changeNext_move(CLICK_CD_BREAKOUT) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index fd4c9f0116e..fef44d69e9d 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -312,13 +312,10 @@ return 0 ..() -/mob/living/carbon/human/restrained() - if(handcuffed) - return 1 - if(istype(wear_suit, /obj/item/clothing/suit/straight_jacket)) - return 1 - return 0 - +/mob/living/carbon/human/get_retraining_item() + . = ..() + if(!. && istype(wear_suit, /obj/item/clothing/suit/straight_jacket)) + . = wear_suit /mob/living/carbon/human/var/temperature_resistance = T0C+75 diff --git a/code/modules/mob/update_status.dm b/code/modules/mob/update_status.dm index 29bcced144a..555486ebf10 100644 --- a/code/modules/mob/update_status.dm +++ b/code/modules/mob/update_status.dm @@ -48,7 +48,10 @@ /mob/proc/restrained(ignore_grab) // All are created free - return 0 + return FALSE + +/mob/proc/get_retraining_item() + return null // Procs that update other things about the mob From b143fb3797bb791781ca5cfe861b124812c58e55 Mon Sep 17 00:00:00 2001 From: joep van der velden Date: Thu, 6 Feb 2020 10:05:54 +0100 Subject: [PATCH 2/2] fixed typo --- code/modules/mob/living/carbon/carbon.dm | 6 +++--- code/modules/mob/living/carbon/human/human.dm | 2 +- code/modules/mob/update_status.dm | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index bc167910747..7347e8eb3e9 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -615,11 +615,11 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, return TRUE /mob/living/carbon/restrained() - if(get_retraining_item()) + if(get_restraining_item()) return TRUE return FALSE -/mob/living/carbon/get_retraining_item() +/mob/living/carbon/get_restraining_item() return handcuffed /mob/living/carbon/unEquip(obj/item/I, force) //THIS PROC DID NOT CALL ..() @@ -776,7 +776,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump, spawn(0) resist_muzzle() var/obj/item/I - if((I = get_retraining_item())) // If there is nothing to restrain him then he is not restrained + if((I = get_restraining_item())) // If there is nothing to restrain him then he is not restrained var/breakouttime = I.breakouttime var/displaytime = breakouttime / 10 changeNext_move(CLICK_CD_BREAKOUT) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index fef44d69e9d..7060a139a60 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -312,7 +312,7 @@ return 0 ..() -/mob/living/carbon/human/get_retraining_item() +/mob/living/carbon/human/get_restraining_item() . = ..() if(!. && istype(wear_suit, /obj/item/clothing/suit/straight_jacket)) . = wear_suit diff --git a/code/modules/mob/update_status.dm b/code/modules/mob/update_status.dm index 555486ebf10..1708bcfb7a2 100644 --- a/code/modules/mob/update_status.dm +++ b/code/modules/mob/update_status.dm @@ -50,7 +50,7 @@ // All are created free return FALSE -/mob/proc/get_retraining_item() +/mob/proc/get_restraining_item() return null // Procs that update other things about the mob