Added sanity checks to VisionControl

This commit is contained in:
Eddoursul 2024-02-20 16:00:05 +01:00
parent d645976f59
commit a84bb1225a
4 changed files with 12 additions and 7 deletions

Binary file not shown.

Binary file not shown.

View File

@ -122,11 +122,13 @@ Function VisionEffectNoTimestop(Formlist RefsInvolved, Formlist ActorsToFreeze =
int nItems = RefsInvolved.GetSize() int nItems = RefsInvolved.GetSize()
While iIndex < nItems While iIndex < nItems
Actor VisionREF = RefsInvolved.GetAt(iIndex) as Actor Actor VisionREF = RefsInvolved.GetAt(iIndex) as Actor
if VisionREF.IsDisabled() if VisionREF
VisionREF.EnableNoWait() if VisionREF.IsDisabled()
EndIf VisionREF.EnableNoWait()
VisionRef.SetAlpha(0.5) EndIf
MS04MemoryFXBody01VFX.Play(VisionREF) VisionRef.SetAlpha(0.5)
MS04MemoryFXBody01VFX.Play(VisionREF)
endif
iIndex += 1 iIndex += 1
EndWhile EndWhile
endif endif
@ -169,8 +171,10 @@ Function VisionEffectNoTimestopStop(Formlist RefsInvolved, Formlist ActorsToFree
Int iIndex = 0 Int iIndex = 0
While iIndex < nItems While iIndex < nItems
Actor VisionREF = RefsInvolved.GetAt(iIndex) as Actor Actor VisionREF = RefsInvolved.GetAt(iIndex) as Actor
MS04MemoryFXBody01VFX.Stop(VisionREF) if VisionREF
VisionRef.SetAlpha(1) MS04MemoryFXBody01VFX.Stop(VisionREF)
VisionRef.SetAlpha(1)
endif
iIndex += 1 iIndex += 1
EndWhile EndWhile
endif endif

View File

@ -167,6 +167,7 @@ EndFunction
Function StartDoorVision() Function StartDoorVision()
; TODO: Fix _00E_FS_NQ02_VisionRefs filled with NPC_ forms and doing nothing
_00E_PlayerFunctions.GetVisionControl().VisionEffectNoTimestop(_00E_FS_NQ02_VisionRefs, _00E_FS_NQ02_SC04_FreezeRefs) _00E_PlayerFunctions.GetVisionControl().VisionEffectNoTimestop(_00E_FS_NQ02_VisionRefs, _00E_FS_NQ02_SC04_FreezeRefs)
FS_NQ02_SC04_Vision.ForceStart() FS_NQ02_SC04_Vision.ForceStart()
_00E_FS_NQ02_TaraREF.Enable() _00E_FS_NQ02_TaraREF.Enable()