Prevent crash if clearing nonexistent scriptdelay

This commit is contained in:
JappaWakka 2025-02-22 12:41:38 +01:00
parent 0b82f53032
commit d01af0ad9d
1 changed files with 17 additions and 16 deletions

View File

@ -98,6 +98,7 @@
Case "cleardelay" Case "cleardelay"
If argument <> "" Then If argument <> "" Then
Dim registerContent() As Object = ActionScript.GetRegisterValue("SCRIPTDELAY_" & argument) Dim registerContent() As Object = ActionScript.GetRegisterValue("SCRIPTDELAY_" & argument)
If registerContent(0) IsNot Nothing Then
Dim delayType As String = CStr(registerContent(0)).GetSplit(0, ";") Dim delayType As String = CStr(registerContent(0)).GetSplit(0, ";")
Select Case delayType.ToLower Select Case delayType.ToLower
Case "steps" Case "steps"
@ -113,7 +114,7 @@
Next Next
Core.Player.ScriptDelayItems = String.Join(";", ItemDelayList) Core.Player.ScriptDelayItems = String.Join(";", ItemDelayList)
End Select End Select
End If
ActionScript.UnregisterID("SCRIPTDELAY_" & argument, "str") ActionScript.UnregisterID("SCRIPTDELAY_" & argument, "str")
ActionScript.UnregisterID("SCRIPTDELAY_" & argument) ActionScript.UnregisterID("SCRIPTDELAY_" & argument)
End If End If