location

location <object> <where>

Whether an object is currently at a named kind of location.

location takes an object and a place name, and reports whether the object is held in that way. It is the precise counterpart to the broader isholding/iswearing vnum tests: those ask "is some object of vnum N here?", while location asks "where is this object right now?".

Arguments

Returns

A booltrue if the object is at the named location, false otherwise.

Examples

after command (say) {
  oload 1
  let item [first [inventory $self]]
  do "say carried=[location $item carried] room=[location $item room]."
}

oload puts object vnum 1 into the owner's inventory, so [location $item carried] is true while [location $item room] is false.

after command (wield) {
  let weapon [first [equipment $actor]]
  require [location $weapon wielded]
  emit room "$self admires the blade $actor just drew."
}

The guard reacts only when the inspected object is actually wielded; otherwise the script advances (see require).

See also