ID:172545
 
How would I construct an if() statement to check if an object is in someone's inventory without defining the person with the inventory?

Delete_Stuff()
for(var/obj/O in world)
if() continue // ?
del(O)
What you are asking is impossible. Try rewording it.
Enigmaster2002 wrote:
How would I construct an if() statement to check if an object is in someone's inventory without defining the person with the inventory?

I just tried "!istype(O.loc,/mob)" and it worked, no garuntees though. ;)

This may be a safer way to do it, though, if you just want to delete objs that are laying on the map.
Delete_Stuff()
for(var/obj/O in world)
if(istype(O.loc,/turf))
del(O)

Hope that helps.
In response to Garthor (#1)
Okay, I have an admin, and I have a player. The Admin has a verb, Delete World. Both have inventories (things in their contents), and the admin uses his delete world verb. All objects in both inventories are deleted. How would I prevent the verb from deleting the inventory items without making a direct reference to a player?