[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
This commit is contained in:
larentoun
2023-07-24 23:26:19 +09:00
committed by GitHub
parent e342c14caf
commit b2d6c34700
+17 -13
View File
@@ -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("<span class='notice'>[usr] picks up the deck.</span>")
if("l_hand")
if(M.put_in_l_hand(src))
add_fingerprint(M)
usr.visible_message("<span class='notice'>[usr] picks up the deck.</span>")
return
add_fingerprint(M)
usr.visible_message("<span class='notice'>[usr] picks up the deck.</span>")
if(over == M && loc != M)
if(M.put_in_hands(src))
add_fingerprint(M)
usr.visible_message("<span class='notice'>[usr] picks up the deck.</span>")
/obj/item/pack
name = "card pack"