ID:175218
 
Whenever i want to delete an item in the users inventory i use this:
for(var/obj/Food/F in usr)
del(F)
But that deletes all objects with that name, how do I make it delete only one of them?
Thanks
var/obj/Food/F = locate() in src
if(F) del(F)


I'm fairly sure you want to be using src, not usr here. Also, the if(F) is important, because if nothing is found, locate() will return null, and trying to delete something that is null results in a runtime error.