4
Fork 0

WaitForReferenceToLoad returns if a ref eventually loaded

development
Eddoursul 2 months ago
parent d49e423ce5
commit 24343b657e
  1. BIN
      scripts/_00E_Func_WaitForRef.pex
  2. 7
      source/scripts/_00E_Func_WaitForRef.psc

Binary file not shown.

@ -1,11 +1,12 @@
Scriptname _00E_Func_WaitForRef Hidden
Function WaitForReferenceToLoad(ObjectReference ref) Global
bool Function WaitForReferenceToLoad(ObjectReference ref, int iFramesToWait = 180) Global
Int maxIterationsToWait = 180
Int maxIterationsToWait = iFramesToWait
While ref.Is3DLoaded() == False && maxIterationsToWait > 0
; Utility.Wait(0.02)
maxIterationsToWait -= 1
EndWhile
return maxIterationsToWait > 0 || ref.Is3DLoaded()
EndFunction

Loading…
Cancel
Save