ID:139480
 
Now, generally identical items should add up in a list.. But for some reason this isn't working... I finally got a system down of getting things out of storage areas, but lets say there's 2 of the same item in a storage area.. Well, it won't work. Even if I pick up both of them, I only get one.. Here's the code..
        if(src in usr.statpanels2)
if(isobj(src))
var/obj/P=src
P.loc=null
usr.contents+=P
global.can1-=P
usr.statpanels2-=P

So yeah, basically, contents seems to only be able to have 1 of a particular item..
Don't know why..

Also, the other problem is I'm trying to make a "click" system for picking up items from a storage area, but it seems like any items with the same name that are lying around are picked up as well, with the code I am using, displayed above. Any help on how to make sure its in usr.statpanels2 only would be greatly appreciated. Thanks :)
Anyone? Also, update... I do receive both of the items.. However, it only displays one of them.
In response to Xyphon101
I read your post earlier, before you bumped it. Nothing really came to mind off the top of my head though. I have made contents-based inventory systems many times in the past and have never had that problem. Multiple items were always interact-able by instance, not as a whole unless specifically programmed to do so.

So either I'm having a temporary lapse in ability, or it is something not listed. Seeing the entire verb/proc for picking up items may help.

One minor issue I noticed is that you are setting the obj's location to null and modifying the verb usr's contents directly. I'm not really sure if that's reliable. It may very well be. I've just always set the obj's loc to the mob who's contents I want it to be moved to instead.
In response to Zagreus
My PickUp() verb is almost exactly the same and it adds them how its supposed to.. So I'm not sure exactly what's wrong.. Also, any ideas about the second problem?

Thanks