mirror of
https://github.com/kwsch/PKHeX.git
synced 2026-04-24 23:57:12 -05:00
Handle slot delete correctly
This commit is contained in:
parent
9f4ff5f070
commit
a293f1b0b4
2
PKHeX.WinForms/Subforms/SAV_Database.Designer.cs
generated
2
PKHeX.WinForms/Subforms/SAV_Database.Designer.cs
generated
|
|
@ -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
|
||||
//
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user