Skip to content

Commit

Permalink
puts the drag_pickup component on card decks (tgstation#59857)
Browse files Browse the repository at this point in the history
  • Loading branch information
spessbro authored Jun 29, 2021
1 parent 3801c24 commit ae078ff
Showing 1 changed file with 1 addition and 18 deletions.
19 changes: 1 addition & 18 deletions code/game/objects/items/toys.dm
Original file line number Diff line number Diff line change
Expand Up @@ -711,6 +711,7 @@

/obj/item/toy/cards/deck/Initialize()
. = ..()
AddElement(/datum/element/drag_pickup)
populate_deck()

///Generates all the cards within the deck.
Expand Down Expand Up @@ -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
Expand Down

0 comments on commit ae078ff

Please sign in to comment.