From 766b46bcc1f9043b4c514c74bb163f67fd5afc97 Mon Sep 17 00:00:00 2001 From: Joshua Kappers Date: Fri, 27 Sep 2024 12:17:22 -0500 Subject: [PATCH] fix: Actions on gump crash when Runebook has no entries (#1964) --- Projects/UOContent/Gumps/RunebookGump.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Projects/UOContent/Gumps/RunebookGump.cs b/Projects/UOContent/Gumps/RunebookGump.cs index 58d771635..7134e3e02 100644 --- a/Projects/UOContent/Gumps/RunebookGump.cs +++ b/Projects/UOContent/Gumps/RunebookGump.cs @@ -133,14 +133,14 @@ private void AddIndex(ref DynamicGumpBuilder builder) for (var i = 0; i < 16; ++i) { - var entry = entries[i]; - // Use charge button builder.AddButton(130 + i / 8 * 160, 65 + i % 8 * 15, 2103, 2104, 2 + i * 6 + 0); // Description label if (i < entries.Count) { + var entry = entries[i]; + builder.AddLabelCropped( 145 + i / 8 * 160, 60 + i % 8 * 15, @@ -257,7 +257,7 @@ public override void OnResponse(NetState state, in RelayInfo info) var index = Math.DivRem(buttonID, 6, out var type); - if (index < 0 || index > _book.Entries.Count) + if (index < 0 || index >= _book.Entries.Count) { return; }