diff --git a/scripts/_00e_fs_nq07_lightscript.pex b/scripts/_00e_fs_nq07_lightscript.pex index 150028c9..b4e5d7dc 100644 Binary files a/scripts/_00e_fs_nq07_lightscript.pex and b/scripts/_00e_fs_nq07_lightscript.pex differ diff --git a/source/scripts/_00e_fs_nq07_lightscript.psc b/source/scripts/_00e_fs_nq07_lightscript.psc index d25d09d8..8bd355d1 100644 --- a/source/scripts/_00e_fs_nq07_lightscript.psc +++ b/source/scripts/_00e_fs_nq07_lightscript.psc @@ -4,14 +4,18 @@ Scriptname _00E_FS_NQ07_LightScript extends activemagiceffect ; EVENTS ;===================================================================================== +bool bActive + Event OnEffectStart(Actor akTarget, Actor akCaster) + bActive = true EnableAllRefsInFormlist() EndEvent Event OnEffectFinish(Actor akTarget, Actor akCaster) + bActive = false DisableAllRefsInFormlist() EndEvent @@ -26,13 +30,20 @@ Function EnableAllRefsInFormlist() while iIndex > 0 - iIndex -= 1 - ObjectReference ref = _00E_FS_NQ07_LightList.GetAt(iIndex) as ObjectReference - ref.EnableNoWait() - _00E_TeleportOutVFX.Play(ref) - ref.GetLinkedRef().EnableNoWait() - MAGIllusionNightEyeOn.Play(ref) - + if ! bActive + return + endif + + iIndex -= 1 + ObjectReference ref = _00E_FS_NQ07_LightList.GetAt(iIndex) as ObjectReference + ref.EnableNoWait() + ref.GetLinkedRef().EnableNoWait() + + if ref.Is3DLoaded() + _00E_TeleportOutVFX.Play(ref) + MAGIllusionNightEyeOn.Play(ref) + endif + endwhile EndFunction @@ -43,11 +54,13 @@ Function DisableAllRefsInFormlist() while iIndex > 0 - iIndex -= 1 - ObjectReference ref = _00E_FS_NQ07_LightList.GetAt(iIndex) as ObjectReference - ref.DisableNoWait() - ref.GetLinkedRef().DisableNoWait() - MAGIllusionNightEyeOff.Play(ref) + iIndex -= 1 + ObjectReference ref = _00E_FS_NQ07_LightList.GetAt(iIndex) as ObjectReference + if ref.Is3DLoaded() + MAGIllusionNightEyeOff.Play(ref) + endif + ref.DisableNoWait() + ref.GetLinkedRef().DisableNoWait() endwhile