From 2f25bcb8c02b847ff090d16ff1450e4021577886 Mon Sep 17 00:00:00 2001 From: DamianX Date: Sat, 21 May 2022 14:30:16 +0200 Subject: [PATCH] Fixed runtime error related to deleting worn items (#17689) * new and improved * Fixed the hard del again --- code/game/objects/items.dm | 4 ---- code/game/objects/items/weapons/storage/storage.dm | 4 ++++ 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm index 545daacb2dd..9757a5f0729 100644 --- a/code/game/objects/items.dm +++ b/code/game/objects/items.dm @@ -166,10 +166,6 @@ GLOBAL_DATUM_INIT(fire_overlay, /image, image("icon" = 'icons/goonstation/effect if(ismob(loc)) var/mob/m = loc m.unEquip(src, 1) - else if(istype(loc, /obj/item/storage)) - var/obj/item/storage/S = loc - if(!QDELETED(S)) // Can happen when the storage gets deleted, thus deleting the contents - S.remove_from_storage(src) // Not required to call. Will only cause runtimes QDEL_LIST(actions) master = null return ..() diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 45ace81c07d..ce24c76a090 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -413,7 +413,11 @@ if(silent) prevent_warning = TRUE I.forceMove(src) + if(QDELING(I)) + return FALSE I.on_enter_storage(src) + if(QDELING(I)) + return FALSE for(var/_M in mobs_viewing) var/mob/M = _M