fix random array index out of range
This commit is contained in:
@@ -27,7 +27,7 @@ public partial class dialog_bubble : CanvasLayer
|
||||
{
|
||||
dlgLines = parsedDlg.AsGodotDictionary()[key].AsGodotArray();
|
||||
if (dlgLines.VariantType == Variant.Type.Array)
|
||||
dlgLines = dlgLines.AsGodotArray()[GD.RandRange(0, dlgLines.AsGodotArray().Count)];
|
||||
dlgLines = dlgLines.AsGodotArray()[GD.RandRange(0, dlgLines.AsGodotArray().Count - 1)];
|
||||
}
|
||||
|
||||
public void CloseDialog()
|
||||
@@ -60,7 +60,6 @@ public partial class dialog_bubble : CanvasLayer
|
||||
GetNode<PanelContainer>("box/panel_container").Visible = true;
|
||||
}
|
||||
}
|
||||
if (dlgLines.AsGodotArray()[dlgPointer].VariantType != Variant.Type.Dictionary)
|
||||
dlgPointer++;
|
||||
}
|
||||
if (richText.VisibleCharacters < Regex.Replace(richText.Text, @"\[[^]]+\]", "").Length && GetNode<Timer>("typewriter_timer").IsStopped())
|
||||
|
Reference in New Issue
Block a user