From the NannyMUD documentation
2000-12-15
NAME
query_worn - return mapping of worn armourLOCATION
Any living object (/obj/living_functions.c)SYNTAX
mapping query_worn();DESCRIPTION
Query_worn() returns a mapping of armour types ("armour", "boot", etc) to those objects of appropriate type worn by the player. If a player is not wearing any armour of that type, the type does not appear in the return.RETURN VALUES
This returns a mapping of armour types to armour objects.NOTE
Approved armour types are armour, boot, glove, helmet, shield, amulet, cloak.EXAMPLE
sprintf("%O", this_player()->query_worn()) -> ([ /* sizeof() == 03 */ "boot" : std/simple_armour#2163, "amulet" : std/simple_armour#5793, "armour" : std/lib/shield#19229, ]) To see if someone were wearing the Boots of Foo, necessary to gain entrance into a certain exclusive bar, one might do query_foo_boots(object player) { object o; o = player->query_worn()["boot"]; if( o && o->id("boots of foo") ) return 1; /* He gets to party the night away */ return 0; /* or else he has to wait outside */ }