draw_card(mob/m)
if(!m.deck.len)
world<<"[m] does not have a deck, or cards to draw."
return
m.deck-=m.deck[m.deck.len]
world<<m.deck[m.deck.len]
m.hand += m.deck[m.deck.len]
Problem description:
I'm trying to make a proc to draw the top card of your deck. However there seems to be more issues than just a runtime error: the last card of the deck vanishes..?
Anyways, what's wrong with this?
EDIT: This is how I'm adding cards to the deck for testing:
mob
verb
create_card()
var/obj/card/c=new/obj/card/basic(src)
deck+=c