fix script.start not being loopable in while loops

this was a weird one to track down
This commit is contained in:
darkfire006 2023-12-06 00:24:57 -06:00
parent 2a869e0b4b
commit 168a442855
1 changed files with 13 additions and 1 deletions

View File

@ -28,6 +28,7 @@ Public Class ActionScript
Public Shared ScriptLevels(99) As ScriptLevel
Public Shared ScriptLevelIndex As Integer = -1
Public Shared emAddToWhile As Boolean = False
Public reDelay As Single = 0.0F
@ -116,7 +117,7 @@ nextScript:
Screen.Camera.Speed = 0.04F
End If
ScriptLevelIndex += 1
emAddToWhile = True
TempSpin = False
Dim arr(99) As Boolean
@ -308,6 +309,13 @@ nextScript:
End Sub
Public Sub AddToWhileQuery(ByVal RemovedScript As Script)
If emAddToWhile = True Then
If ScriptLevelIndex = 0 Then
emAddToWhile = False
Else
ScriptLevelIndex -= 1
End If
End If
If CSL().WhileQueryInitialized = True And CSL().ScriptVersion = 2 Then
CSL().WhileQuery.Add(RemovedScript)
@ -323,6 +331,10 @@ nextScript:
CSL().WhileQueryInitialized = False
End If
End If
If emAddToWhile = True Then
ScriptLevelIndex += 1
emAddToWhile = False
End If
End Sub
#Region "Registers"