diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm index 6eded14811b..b40c8e881b2 100644 --- a/code/game/objects/items/weapons/storage/storage.dm +++ b/code/game/objects/items/weapons/storage/storage.dm @@ -324,7 +324,7 @@ //Call this proc to handle the removal of an item from the storage item. The item will be moved to the atom sent as new_target -/obj/item/weapon/storage/proc/remove_from_storage(obj/item/W, atom/new_location) +/obj/item/weapon/storage/proc/remove_from_storage(obj/item/W, atom/new_location, burn = 0) if(!istype(W)) return 0 if(istype(src, /obj/item/weapon/storage/fancy)) @@ -350,9 +350,15 @@ W.on_exit_storage(src) update_icon() W.mouse_opacity = initial(W.mouse_opacity) + if(burn) + W.fire_act() return 1 +/obj/item/weapon/storage/empty_object_contents(burn, src.loc) + for(var/obj/item/Item in contents) + remove_from_storage(Item, src.loc, burn) + //This proc is called when you want to place an item into the storage item. /obj/item/weapon/storage/attackby(obj/item/W, mob/user, params) ..() diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index b13c719b45b..0ba86b0735f 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -173,9 +173,7 @@ return 1 /obj/proc/burn() - for(var/obj/item/Item in contents) //Empty out the contents - Item.loc = src.loc - Item.fire_act() //Set them on fire, too + empty_object_contents(1, src.loc) var/obj/effect/decal/cleanable/ash/A = new(src.loc) A.desc = "Looks like this used to be a [name] some time ago." SSobj.burning -= src @@ -185,4 +183,12 @@ if(burn_state == 1) burn_state = 0 overlays -= fire_overlay - SSobj.burning -= src \ No newline at end of file + SSobj.burning -= src + + + +/obj/proc/empty_object_contents(burn = 0, new_loc = src.loc) + for(var/obj/item/Item in contents) //Empty out the contents + Item.loc = new_loc + if(burn) + Item.fire_act() //Set them on fire, too \ No newline at end of file diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm index 6eabe44a859..da953617dd0 100644 --- a/code/modules/mob/living/carbon/human/inventory.dm +++ b/code/modules/mob/living/carbon/human/inventory.dm @@ -278,8 +278,7 @@ Human.unEquip(src) if(bomb) - for(var/obj/item/Item in contents) //Empty out the contents - Item.loc = src.loc + empty_object_contents() spawn(1) //so the shreds aren't instantly deleted by the explosion var/obj/effect/decal/cleanable/shreds/Shreds = new(loc) Shreds.desc = "The sad remains of what used to be [src.name]."