From b2d6c34700b5ccc0332671d2c714fbeba7e6951e Mon Sep 17 00:00:00 2001 From: larentoun <31931237+larentoun@users.noreply.github.com> Date: Mon, 24 Jul 2023 23:26:19 +0900 Subject: [PATCH] [FIX] Fixes the player eating a deck of cards (#21657) * fix: Correct newLoc for deck of cards https://github.com/ss220-space/Paradise/pull/1284 * changes logic a bit --- code/modules/games/cards.dm | 30 +++++++++++++++++------------- 1 file changed, 17 insertions(+), 13 deletions(-) diff --git a/code/modules/games/cards.dm b/code/modules/games/cards.dm index ad4c19fed79..2283e16b44f 100644 --- a/code/modules/games/cards.dm +++ b/code/modules/games/cards.dm @@ -256,27 +256,31 @@ cooldown = world.time -/obj/item/deck/MouseDrop(atom/over_object) // Code from Paper bin, so you can still pick up the deck +/obj/item/deck/MouseDrop(atom/over, src_location, over_location, src_control, over_control, params) var/mob/M = usr if(M.incapacitated() || !Adjacent(M)) return if(!ishuman(M)) return - if(over_object == M || istype(over_object, /obj/screen)) - if(!remove_item_from_storage(M)) + if(istype(over, /obj/screen)) + if(!remove_item_from_storage(get_turf(M))) M.unEquip(src) - if(over_object != M) - switch(over_object.name) - if("r_hand") - M.put_in_r_hand(src) - if("l_hand") - M.put_in_l_hand(src) - else - M.put_in_hands(src) + switch(over.name) + if("r_hand") + if(M.put_in_r_hand(src)) + add_fingerprint(M) + usr.visible_message("[usr] picks up the deck.") + if("l_hand") + if(M.put_in_l_hand(src)) + add_fingerprint(M) + usr.visible_message("[usr] picks up the deck.") + return - add_fingerprint(M) - usr.visible_message("[usr] picks up the deck.") + if(over == M && loc != M) + if(M.put_in_hands(src)) + add_fingerprint(M) + usr.visible_message("[usr] picks up the deck.") /obj/item/pack name = "card pack"