Click()
if(usr.Loot)
if(usr.Loot.Inventory.Find(src))
if(wear)
src:Wear()
if(type != /obj/Items/Berry)Drop()
if(type == /obj/Items/Berry)src:Drop_All()
return
if(winget(usr,"ShoppingScreen","is-visible") == "true")
if(usr.Inventory.Find(src)&&!wear)
if(type == /obj/Items/Berry)return
switch(alert(usr,"Would you like to sell [src] for [num_handle(round(Cost/2,1))]?",name,"No","Yes"))
if("No")
return
if("Yes")
for(var/obj/Items/Berry/B in usr.Inventory)
B.Amount += round(Cost/2,1)
B.Amount()
goto End
var/obj/Items/Berry/B = new/obj/Items/Berry
B.Amount = round(Cost/2,1)
B.loc = usr.loc
B.Get()
End
del(src)
return
if(winget(usr,"ShoppingScreen1","is-visible") == "true")
if(usr.Inventory.Find(src)&&!wear)
if(type == /obj/Items/Berry)return
switch(alert(usr,"Would you like to sell [src] for [num_handle(round(Cost/2,1))]?",name,"No","Yes"))
if("No")
return
if("Yes")
for(var/obj/Items/Berry/B in usr.Inventory)
B.Amount += round(Cost/2,1)
B.Amount()
goto End
var/obj/Items/Berry/B = new/obj/Items/Berry
B.Amount = round(Cost/2,1)
B.loc = usr.loc
B.Get()
End
del(src)
return
if(get_dist(src,usr) <= 1)
if(usr.Inventory.Find(src))return
for(var/mob/M in world)
if(M.Inventory.Find(src))return
Get()
Get()
set category = null
set hidden = 1
set src in oview(1)
if(!usr.Conscious)return
if(Weight > usr.Strength)
usr << output("[src] is too heavy for you.","SM")
return
usr.Inventory.Add(src)
Move(usr)
Problem description:Then two players clicks the item on same time it gets cloned! Two same item on their inventory. There has no sleep or something giving delay so I could not understand what can cause this.
I'm guessing it's getting cloned because your loop isn't instant and if two players are fast enough they can both pick it up before a full loop