Handle slot delete correctly

This commit is contained in:
Kurt 2021-08-05 12:15:55 -07:00
parent 9f4ff5f070
commit a293f1b0b4
2 changed files with 4 additions and 4 deletions

View File

@ -935,7 +935,6 @@ private void InitializeComponent()
this.mnuDelete});
this.mnu.Name = "mnu";
this.mnu.Size = new System.Drawing.Size(108, 48);
this.mnu.Click += new System.EventHandler(this.ClickView);
//
// mnuView
//
@ -943,6 +942,7 @@ private void InitializeComponent()
this.mnuView.Name = "mnuView";
this.mnuView.Size = new System.Drawing.Size(107, 22);
this.mnuView.Text = "View";
this.mnuView.Click += new System.EventHandler(this.ClickView);
//
// mnuDelete
//

View File

@ -157,8 +157,8 @@ private void ClickDelete(object sender, EventArgs e)
else if (entry.Source is SlotInfoBox b && entry.SAV == SAV)
{
// Data from Box: Delete from save file
int box = b.Box-1;
int slot = b.Slot-1;
int box = b.Box;
int slot = b.Slot;
var change = new SlotInfoBox(box, slot);
var pkSAV = change.Read(SAV);
@ -220,7 +220,7 @@ private void ClickSet(object sender, EventArgs e)
private bool GetShiftedIndex(ref int index)
{
if (index >= RES_MAX)
if ((uint)index >= RES_MAX)
return false;
index += SCR_Box.Value * RES_MIN;
return index < Results.Count;