Difference between revisions of "Talk:IsInInterior - ObjectReference"

Jump to navigation Jump to search
m
Undo revision 46626 by Lisselli (talk)
imported>Lisselli
m (On making this function faster.)
imported>Lisselli
m (Undo revision 46626 by Lisselli (talk))
Line 101: Line 101:
return false
return false
EndFunction </source>
EndFunction </source>
This function is much slower than its counterpart [[IsInterior - Cell]]. It is basically a convenience function. Both of the above functions takes about 65ms to finish, it calls GetParentCell and InInterior in addition to IsInterior. You should store the myObject.GetParentCell() to a variable first and then pass it the function. You can reduce them to 31 frames by doing this instead(Using the second function as an example):
<source lang="papyrus">
Bool Function IsInteriorAWorldSpace(Cell akCell, ObjectReference akObjectReference)
Int i = 0
Int iIndex = WorldSpaces.Length
if akCell && akCell.IsInterior()
return true
else
While i < iIndex
if akObjectReference.GetWorldSpace() == WorldSpaces[i]
return true
else
i += 1
endif
EndWhile
endif
return false
EndFunction </source>
This will return false when in an exterior, or if GetParentCell returns none due to the issue with IsInterior. --[[User:Lisselli|Lisselli]] ([[User talk:Lisselli|talk]])
Anonymous user

Navigation menu