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()
While iIndex < nItems
Actor VisionREF = RefsInvolved.GetAt(iIndex) as Actor
if VisionREF
if VisionREF.IsDisabled()
VisionREF.EnableNoWait()
EndIf
VisionRef.SetAlpha(0.5)
MS04MemoryFXBody01VFX.Play(VisionREF)
endif
iIndex += 1
EndWhile
endif
@ -169,8 +171,10 @@ Function VisionEffectNoTimestopStop(Formlist RefsInvolved, Formlist ActorsToFree
Int iIndex = 0
While iIndex < nItems
Actor VisionREF = RefsInvolved.GetAt(iIndex) as Actor
if VisionREF
MS04MemoryFXBody01VFX.Stop(VisionREF)
VisionRef.SetAlpha(1)
endif
iIndex += 1
EndWhile
endif

View File

@ -167,6 +167,7 @@ EndFunction
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)
FS_NQ02_SC04_Vision.ForceStart()
_00E_FS_NQ02_TaraREF.Enable()