From 9ebd7c3cf170fe7e57d6c23cd85bd6d23388ab05 Mon Sep 17 00:00:00 2001 From: Leland Kemble <70413276+lelandkemble@users.noreply.github.com> Date: Wed, 10 Sep 2025 19:47:11 -0400 Subject: [PATCH] fixes mouse stored inside holder when killed (#92232) ## About The Pull Request Makes mice go where they were when you kill them, rather than being stored inside whatever mob was holding them. Mice on your shoulder fall off, instead. Also fixes unrelated runtime happening in parallel ## Why It's Good For The Game fixes #91057 ## Changelog :cl: fix: mice stored on your person will no longer disappear when killed /:cl: --------- Co-authored-by: ArcaneMusic <41715314+ArcaneMusic@users.noreply.github.com> --- code/modules/mob/living/basic/vermin/mouse.dm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/code/modules/mob/living/basic/vermin/mouse.dm b/code/modules/mob/living/basic/vermin/mouse.dm index 9acddd1c860..738a711d3c9 100644 --- a/code/modules/mob/living/basic/vermin/mouse.dm +++ b/code/modules/mob/living/basic/vermin/mouse.dm @@ -142,9 +142,19 @@ if(!gibbed) var/make_a_corpse = TRUE var/place_to_make_corpse = loc + var/must_equip = FALSE + var/equip_slot + var/mob/holding_mob + var/obj/item/mob_holder/found_holder if(istype(loc, /obj/item/mob_holder))//If our mouse is dying in place holder we want to put the dead mouse where the place holder was - var/obj/item/mob_holder/found_holder = loc + found_holder = loc place_to_make_corpse = found_holder.loc + if(istype(found_holder.loc,/mob/living/carbon)) + holding_mob = found_holder.loc + place_to_make_corpse = get_turf(holding_mob) + equip_slot = holding_mob.get_slot_by_item(found_holder) + if(equip_slot == ITEM_SLOT_HANDS || equip_slot == ITEM_SLOT_RPOCKET || equip_slot == ITEM_SLOT_LPOCKET) + must_equip = TRUE if(istype(found_holder.loc, /obj/machinery/microwave))//Microwaves gib things that die when cooked, so we don't need to make a dead body too make_a_corpse = FALSE if(make_a_corpse) @@ -153,6 +163,11 @@ if(HAS_TRAIT(src, TRAIT_BEING_SHOCKED)) mouse.desc = "They're toast." mouse.add_atom_colour("#3A3A3A", FIXED_COLOUR_PRIORITY) + found_holder?.release(FALSE) + if(must_equip) + if(equip_slot == ITEM_SLOT_HANDS) + holding_mob.dropItemToGround(found_holder) + holding_mob.equip_to_slot(mouse,equip_slot) qdel(src) /mob/living/basic/mouse/UnarmedAttack(atom/attack_target, proximity_flag, list/modifiers)