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();
|
dlgLines = parsedDlg.AsGodotDictionary()[key].AsGodotArray();
|
||||||
if (dlgLines.VariantType == Variant.Type.Array)
|
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()
|
public void CloseDialog()
|
||||||
@@ -60,7 +60,6 @@ public partial class dialog_bubble : CanvasLayer
|
|||||||
GetNode<PanelContainer>("box/panel_container").Visible = true;
|
GetNode<PanelContainer>("box/panel_container").Visible = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (dlgLines.AsGodotArray()[dlgPointer].VariantType != Variant.Type.Dictionary)
|
|
||||||
dlgPointer++;
|
dlgPointer++;
|
||||||
}
|
}
|
||||||
if (richText.VisibleCharacters < Regex.Replace(richText.Text, @"\[[^]]+\]", "").Length && GetNode<Timer>("typewriter_timer").IsStopped())
|
if (richText.VisibleCharacters < Regex.Replace(richText.Text, @"\[[^]]+\]", "").Length && GetNode<Timer>("typewriter_timer").IsStopped())
|
||||||
|
Reference in New Issue
Block a user