ID:141490
 
Code:
        verb
Drop()
for(var/obj/Potion/O in usr.contents)
if(O.ammount<=0)
del(O)
else
var/drop = input("How many potions do you wish to drop?")as num
if(O.ammount<drop)
usr<<"You don't have that many to drop."
return
if(drop<=0)
usr<<"You cannot do that."
return
if(O.ammount>=drop)
O.ammount-=drop
var/obj/Potion/B = new/obj/Potion
B.loc=locate(usr.x,usr.y-1,usr.z)
B.ammount=drop
view(usr)<<"[usr] drops [drop] potions."
O.name = "Potion"
O.name= "[O.name]: [O.ammount]"
if(O.ammount<=0)
del(O)


Problem description:Well if I drop all of the items in my inventory of one type i won't be able to pick it up. when i get another one of the same item from item test area,then i can pick it up (I made for testing that I can pick up items in one area...no buying so far)

Did you create a verb like Pick-up or get so you can receive the item?
In response to Tales2008
Of course i did.....how would i be able to pick up items from item test area if i didn't have it xD?

            Get()
set src in oview(1)
usr<<"You picked up [src]"
for(var/obj/Potion/O in usr.contents)
counter+=1
if(counter<=0)
Move(usr)
else
for(var/obj/Potion/O in usr.contents)
O.ammount+=src.ammount
O.name = "Potion"
O.name= "[O.name]: [O.ammount]"
del(src)
In response to Destrojer
Mehk, that's a bad Get() verb there... I hope you're not also repeating duplicate code (maybe even redefining all verbs) on each item type's Get() verb to get it to stack, and for some reason in your game only potions need to stack. >_>
In response to Kaioken
I did the Get verb on every item...it all works.....but there is something in drop that is buggy....if i Drop all items of the same type i can't pick them up....but i can pick up the item that i placed on map (which has respawn time).And if i have 2 potions,and i drop 1....then i can pick the one i droped but if i drop 2...i can't pick them up...i can only pick them up if i get the potion from the respawn thingy,and then come and pick them up.
In response to Destrojer
I mean i can't find anything wrong with the code,as for coding with stackable....i don't really know how to do it.