From f0c0c0a30810d464e24397ec8167eb5de21312ab Mon Sep 17 00:00:00 2001 From: Maruno17 Date: Fri, 18 Sep 2020 20:22:02 +0100 Subject: [PATCH] Fixed crashes in debug functions if there's a gap in item ID numbers --- Data/Scripts/021_Debug/004_Editor_Screens.rb | 7 ------- Data/Scripts/021_Debug/007_Editor_Listers.rb | 1 + 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/Data/Scripts/021_Debug/004_Editor_Screens.rb b/Data/Scripts/021_Debug/004_Editor_Screens.rb index 5568fdf27..8f0410600 100644 --- a/Data/Scripts/021_Debug/004_Editor_Screens.rb +++ b/Data/Scripts/021_Debug/004_Editor_Screens.rb @@ -669,13 +669,6 @@ def pbItemEditorNew(defaultname) itemdata = pbLoadItemsData # Get the first blank ID for the new item to use. maxid = PBItems.maxValue+1 - for i in 1..PBItems.maxValue - name = itemdata[i][1] - if !name || name=="" || itemdata[i][ITEM_POCKET]==0 - maxid = i - break - end - end index = maxid itemname = pbMessageFreeText(_INTL("Please enter the item's name."), (defaultname) ? defaultname.gsub(/_+/," ") : "",false,30) diff --git a/Data/Scripts/021_Debug/007_Editor_Listers.rb b/Data/Scripts/021_Debug/007_Editor_Listers.rb index 936b4e4c4..330f495d1 100644 --- a/Data/Scripts/021_Debug/007_Editor_Listers.rb +++ b/Data/Scripts/021_Debug/007_Editor_Listers.rb @@ -407,6 +407,7 @@ class ItemLister @itemdata = pbLoadItemsData cmds = [] for i in 1..PBItems.maxValue + next if !@itemdata[i] name = @itemdata[i][ITEM_NAME] if name && name!="" && @itemdata[i][ITEM_POCKET]!=0 cmds.push([i,name])