From 03d0699637fb429243e5cdf229536ca63a975e49 Mon Sep 17 00:00:00 2001 From: DZD Date: Tue, 10 Feb 2015 09:25:54 -0500 Subject: [PATCH] Fixes runtime with getting inventory - Fixes runtime at living.dm line 195, when return_inv() is called for suits and accessories that store items. - Fixes use of 'stat == 2' instead of 'stat == DEAD' in objective.dm --- code/game/gamemodes/objective.dm | 2 +- code/modules/clothing/suits/storage.dm | 16 +++++++++++++++- .../clothing/under/accessories/storage.dm | 14 ++++++++++++++ 3 files changed, 30 insertions(+), 2 deletions(-) diff --git a/code/game/gamemodes/objective.dm b/code/game/gamemodes/objective.dm index f80b943cf76..3f9117f07b7 100644 --- a/code/game/gamemodes/objective.dm +++ b/code/game/gamemodes/objective.dm @@ -420,7 +420,7 @@ datum/objective/escape return 0 if(!emergency_shuttle.returned()) return 0 - if(!owner.current || owner.current.stat ==2) + if(!owner.current || owner.current.stat == DEAD) return 0 var/turf/location = get_turf(owner.current.loc) if(!location) diff --git a/code/modules/clothing/suits/storage.dm b/code/modules/clothing/suits/storage.dm index cb03feb5997..c3b5c6f616a 100644 --- a/code/modules/clothing/suits/storage.dm +++ b/code/modules/clothing/suits/storage.dm @@ -26,4 +26,18 @@ /obj/item/clothing/suit/storage/hear_talk(mob/M, var/msg) pockets.hear_talk(M, msg) - ..() \ No newline at end of file + ..() + +/obj/item/clothing/suit/storage/proc/return_inv() + + var/list/L = list( ) + + L += src.contents + + for(var/obj/item/weapon/storage/S in src) + L += S.return_inv() + for(var/obj/item/weapon/gift/G in src) + L += G.gift + if (istype(G.gift, /obj/item/weapon/storage)) + L += G.gift:return_inv() + return L \ No newline at end of file diff --git a/code/modules/clothing/under/accessories/storage.dm b/code/modules/clothing/under/accessories/storage.dm index 8a215233b08..caa7638befd 100644 --- a/code/modules/clothing/under/accessories/storage.dm +++ b/code/modules/clothing/under/accessories/storage.dm @@ -40,6 +40,20 @@ hold.hear_talk(M, msg, verb, speaking) ..() +/obj/item/clothing/accessory/storage/proc/return_inv() + + var/list/L = list( ) + + L += src.contents + + for(var/obj/item/weapon/storage/S in src) + L += S.return_inv() + for(var/obj/item/weapon/gift/G in src) + L += G.gift + if (istype(G.gift, /obj/item/weapon/storage)) + L += G.gift:return_inv() + return L + /obj/item/clothing/accessory/storage/attack_self(mob/user as mob) if (has_suit) //if we are part of a suit hold.open(user)