obj/Inventory
Resources
verb
Drop(n as num)
usr.itemDrop(src,n)
usr << "You drop [n] [src]."
return
mob/proc
itemDrop(obj/Inventory/o, n as num)
if(o.canStack && o.contents.len)
for(.=n;.>0;.--)
var/obj/Inventory/theItem=pick(o.contents)
theItem.loc=get_step(usr,usr.dir)
if(o.contents.len)
o.suffix="x[o.contents.len+1]"
else
o.suffix="x1"
else
o.loc=src.loc
o.suffix=""
Problem description:
It works as intended, but it drops 4 instances of the dropped resource. How do I make it so it drops it all in one object?