diff --git a/code/datums/storage/storage.dm b/code/datums/storage/storage.dm index 0b0a92611e7..583bac0a9f4 100644 --- a/code/datums/storage/storage.dm +++ b/code/datums/storage/storage.dm @@ -475,6 +475,8 @@ GLOBAL_LIST_EMPTY(cached_storage_typecaches) to_insert.forceMove(real_location) item_insertion_feedback(user, to_insert, override) parent.update_appearance() + if(get(real_location, /mob) != user) + to_insert.do_pickup_animation(real_location, user) return TRUE /// Since items inside storages ignore transparency for QOL reasons, we're tracking when things are dropped onto them instead of our UI elements diff --git a/code/game/machinery/_machinery.dm b/code/game/machinery/_machinery.dm index 949950b1499..f5afeb98f5f 100644 --- a/code/game/machinery/_machinery.dm +++ b/code/game/machinery/_machinery.dm @@ -409,8 +409,9 @@ * * object (obj) The object to be moved in to the users hand. * * user (mob/living) The user to recive the object */ -/obj/machinery/proc/try_put_in_hand(obj/object, mob/living/user) +/obj/machinery/proc/try_put_in_hand(obj/item/object, mob/living/user) if(!issilicon(user) && in_range(src, user)) + object.do_pickup_animation(user, src) user.put_in_hands(object) else object.forceMove(drop_location()) diff --git a/code/game/machinery/civilian_bounties.dm b/code/game/machinery/civilian_bounties.dm index 22ea6994ee6..913223fded7 100644 --- a/code/game/machinery/civilian_bounties.dm +++ b/code/game/machinery/civilian_bounties.dm @@ -286,14 +286,12 @@ return TRUE ///Removes A stored ID card. -/obj/machinery/computer/piratepad_control/civilian/proc/id_eject(mob/user, obj/target) +/obj/machinery/computer/piratepad_control/civilian/proc/id_eject(mob/user, obj/item/target) if(!target) to_chat(user, span_warning("That slot is empty!")) return FALSE else - target.forceMove(drop_location()) - if(!issilicon(user) && Adjacent(user)) - user.put_in_hands(target) + try_put_in_hand(target, user) user.visible_message(span_notice("[user] gets \the [target] from \the [src]."), \ span_notice("You get \the [target] from \the [src].")) playsound(src, 'sound/machines/terminal/terminal_insert_disc.ogg', 50, FALSE) diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm index a71b4293f6a..479c9fe2086 100644 --- a/code/game/objects/structures/tables_racks.dm +++ b/code/game/objects/structures/tables_racks.dm @@ -495,7 +495,7 @@ /obj/structure/table/proc/table_place_act(mob/living/user, obj/item/tool, list/modifiers) if(tool.item_flags & ABSTRACT) return NONE - if(!user.transferItemToLoc(tool, drop_location(), silent = FALSE)) + if(!user.dropItemToGround(to_drop = tool, silent = FALSE, newloc = get_turf(src))) return ITEM_INTERACT_BLOCKING // Items are centered by default, but we move them if click ICON_X and ICON_Y are available if(LAZYACCESS(modifiers, ICON_X) && LAZYACCESS(modifiers, ICON_Y)) diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm index db5bb011fd3..e96c6d1c5bd 100644 --- a/code/modules/mob/inventory.dm +++ b/code/modules/mob/inventory.dm @@ -334,26 +334,26 @@ * * If it was, returns the item. * If the item can be dropped, it will be forceMove()'d to the ground and the turf's Entered() will be called. */ -/mob/proc/dropItemToGround(obj/item/I, force = FALSE, silent = FALSE, invdrop = TRUE) - if (isnull(I)) +/mob/proc/dropItemToGround(obj/item/to_drop, force = FALSE, silent = FALSE, invdrop = TRUE, turf/newloc = null) + if(isnull(to_drop)) return SEND_SIGNAL(src, COMSIG_MOB_DROPPING_ITEM) - var/try_uneqip = doUnEquip(I, force, drop_location(), FALSE, invdrop = invdrop, silent = silent) + var/try_uneqip = doUnEquip(to_drop, force, newloc ? newloc : drop_location(), FALSE, invdrop = invdrop, silent = silent) - if(!try_uneqip || !I) //ensure the item exists and that it was dropped properly. + if(!try_uneqip || !to_drop) //ensure the item exists and that it was dropped properly. return - if(!(I.item_flags & NO_PIXEL_RANDOM_DROP)) - I.pixel_x = I.base_pixel_x + rand(-6, 6) - I.pixel_y = I.base_pixel_y + rand(-6, 6) - I.do_drop_animation(src) - return I + if(!(to_drop.item_flags & NO_PIXEL_RANDOM_DROP)) + to_drop.pixel_x = to_drop.base_pixel_x + rand(-6, 6) + to_drop.pixel_y = to_drop.base_pixel_y + rand(-6, 6) + to_drop.do_drop_animation(src) + 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) . = doUnEquip(I, force, newloc, FALSE, silent = silent) - I.do_drop_animation(src) + 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 diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm index becae6fb181..d0b09229304 100644 --- a/code/modules/mob/living/carbon/carbon.dm +++ b/code/modules/mob/living/carbon/carbon.dm @@ -1512,8 +1512,8 @@ return ..() -/mob/living/carbon/dropItemToGround(obj/item/item, force = FALSE, silent = FALSE, invdrop = TRUE) - if(item && ((item in organs) || (item in bodyparts))) //let's not do this, aight? +/mob/living/carbon/dropItemToGround(obj/item/to_drop, force = FALSE, silent = FALSE, invdrop = TRUE, turf/newloc = null) + if(to_drop && (organs.Find(to_drop) || bodyparts.Find(to_drop))) //let's not do this, aight? return FALSE return ..() diff --git a/code/modules/vending/_vending.dm b/code/modules/vending/_vending.dm index 70ecf091c07..9bc279a9bd1 100644 --- a/code/modules/vending/_vending.dm +++ b/code/modules/vending/_vending.dm @@ -1469,6 +1469,7 @@ GLOBAL_LIST_EMPTY(vending_machines_to_restock) vended_item.set_greyscale(colors=greyscale_colors) if(usr.CanReach(src) && usr.put_in_hands(vended_item)) to_chat(usr, span_notice("You take [item_record.name] out of the slot.")) + vended_item.do_pickup_animation(usr, src) else to_chat(usr, span_warning("[capitalize(format_text(item_record.name))] falls onto the floor!")) SSblackbox.record_feedback("nested tally", "vending_machine_usage", 1, list("[type]", "[item_record.product_path]"))