IsInLocation - ObjectReference

Member of: ObjectReference Script

Checks to see if this object is in the specified location, or in a child of the specified location.

SyntaxEdit

bool Function IsInLocation(Location akLocation)
	Location currLoc = GetCurrentLocation()
	if currLoc == None
		return false
	else
		return akLocation.IsChild(currLoc) || currLoc == akLocation
	endif
endFunction

ParametersEdit

Return ValueEdit

Whether this reference is in the specified location.

ExamplesEdit

; Is the box in the house location?
if Box.IsInLocation(House)
  Debug.Trace("Box is in the house!")
endIf

See AlsoEdit