WaitForReferenceToLoad returns if a ref eventually loaded

This commit is contained in:
Eddoursul 2024-02-25 23:21:01 +01:00
parent d49e423ce5
commit 24343b657e
2 changed files with 4 additions and 3 deletions

Binary file not shown.

View File

@ -1,11 +1,12 @@
Scriptname _00E_Func_WaitForRef Hidden 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 While ref.Is3DLoaded() == False && maxIterationsToWait > 0
; Utility.Wait(0.02)
maxIterationsToWait -= 1 maxIterationsToWait -= 1
EndWhile EndWhile
return maxIterationsToWait > 0 || ref.Is3DLoaded()
EndFunction EndFunction