if(locate(/obj/Items/Food/Apple) in usr)
var/obj/Apple = locate(/obj/Items/Food/Apple) in usr.contents
del Apple
ID:172380
May 20 2004, 4:21 pm
|
|
I was just wondering if this is a safe way to code this. If not can you tell me a better way please.What im trying to do is check if there is a item in the player and if there is delete it.
|
In response to Volte
|
|
Thanks but Is there a problem with having locate twice or is it just that its a waste of space
|
In response to Turles9000
|
|
Turles9000 wrote:
Thanks but Is there a problem with having locate twice or is it just that its a waste of space It won't cause errors or anything, but it's just a longer, less efficient way. ~>Volte |
In response to Volte
|
|
K Thanks again
|
That should work fine in a verb. If it's not in a verb, you shouldn't use usr, though.
Here's a better way:
It does the same thing, but it keeps it from having to locate() it twice.
~>Volte