From 48d0d920b1886aaeeaee874cb4a244df6943db44 Mon Sep 17 00:00:00 2001 From: Joshua Kidder <49173900+Metekillot@users.noreply.github.com> Date: Thu, 15 May 2025 15:22:26 -0400 Subject: [PATCH] Fixes item pickup animation playing when you move some things to containers on your person (#91128) Co-authored-by: SmArtKar <44720187+SmArtKar@users.noreply.github.com> --- code/modules/mob/inventory.dm | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index b5807c261e9..2ed1e24d04a 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -351,9 +351,16 @@ return to_drop //for when the item will be immediately placed in a loc other than the ground -/mob/proc/transferItemToLoc(obj/item/I, newloc = null, force = FALSE, silent = TRUE) +/mob/proc/transferItemToLoc(obj/item/I, newloc = null, force = FALSE, silent = TRUE, animated = null) . = doUnEquip(I, force, newloc, FALSE, silent = silent) - I.do_pickup_animation(newloc, src) + //This proc wears a lot of hats for moving items around in different ways, + //so we assume unhandled cases for checking to animate can safely be handled + //with the same logic we handle animating putting items in container (container on your person isn't animated) + if(isnull(animated)) + //if the item's ultimate location is us, we don't animate putting it wherever + animated = !(get(newloc, /mob) == src) + if(animated) + I.do_pickup_animation(newloc, src) //visibly unequips I but it is NOT MOVED AND REMAINS IN SRC, newloc is for signal handling checks only which hints where you want to move the object after removal //item MUST BE FORCEMOVE'D OR QDEL'D