puts the drag_pickup component on card decks (#59857)

This commit is contained in:
spessbro
2021-06-29 01:45:18 -07:00
committed by GitHub
parent 3801c24229
commit ae078ffbfa
+1 -18
View File
@@ -711,6 +711,7 @@
/obj/item/toy/cards/deck/Initialize()
. = ..()
AddElement(/datum/element/drag_pickup)
populate_deck()
///Generates all the cards within the deck.
@@ -799,24 +800,6 @@
else
return ..()
/obj/item/toy/cards/deck/MouseDrop(atom/over_object)
. = ..()
var/mob/living/M = usr
if(!istype(M) || !(M.mobility_flags & MOBILITY_PICKUP))
return
if(Adjacent(usr))
if(over_object == M && loc != M)
M.put_in_hands(src)
to_chat(usr, span_notice("You pick up the deck."))
else if(istype(over_object, /atom/movable/screen/inventory/hand))
var/atom/movable/screen/inventory/hand/H = over_object
if(M.putItemFromInventoryInHandIfPossible(src, H.held_index))
to_chat(usr, span_notice("You pick up the deck."))
else
to_chat(usr, span_warning("You can't reach it from here!"))
/obj/item/toy/cards/cardhand