Basically, I have a garbage can system.. And often there will be identical objects in there, which causes problems, especially since it glitches if any of these objects are also on the ground.. I did:
Click()
if(src in usr.statpanels2)
if(isobj(src))
switch(input(usr,"Are you sure you want to take the [src]?") in list("Yes", "No"))
if("Yes")
var/obj/P=src
P.loc=null
usr.contents.Add(P)
if(usr.statpaneled=="can1")
global.can1-=P
usr.statpanels2-=P
else
return
else
return
else
return
But clearly that didn't work..
Some people may say "put this in Code Problems".. But I'm not asking for an error, because I know that there is no error, and that I'm just not doing it right. Basically, what happens is, if they are identical items only one will ever get added to the list, and if there is one on the ground.. Well, it gets really messed up.. So, please help, thank you!
Or:
if(list.Find(X))
Your issue does not lie with BYOND magically making two objects into one. You've messed something up elsewhere, likely in populating the can1 list or the statpanels2 list.