From 9daa73adf3d1ee812e8c56e9636370151aceca94 Mon Sep 17 00:00:00 2001 From: Kurt Date: Mon, 15 Dec 2014 18:13:46 -0800 Subject: [PATCH] Disallow species = 0 --- SAV/SAV_HallOfFame.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/SAV/SAV_HallOfFame.cs b/SAV/SAV_HallOfFame.cs index 41e76224f..27c47d0ae 100644 --- a/SAV/SAV_HallOfFame.cs +++ b/SAV/SAV_HallOfFame.cs @@ -82,9 +82,11 @@ namespace PKHeX #region Species { + var species_list = Util.getCBList(Form1.specieslist, null); + species_list.RemoveAt(0); // Remove 0th Entry CB_Species.DisplayMember = "Text"; CB_Species.ValueMember = "Value"; - CB_Species.DataSource = new BindingSource(m_parent.CB_Species.DataSource, null); + CB_Species.DataSource = species_list; } #endregion #region Moves @@ -197,7 +199,7 @@ namespace PKHeX if (sender != null) { - NUP_PartyIndex.Maximum = moncount; + NUP_PartyIndex.Maximum = (moncount == 0) ? 1 : moncount; NUP_PartyIndex.Value = 1; NUP_PartyIndex_ValueChanged(sender, e); } @@ -212,6 +214,8 @@ namespace PKHeX int index = listBox1.SelectedIndex; int offset = index * 0x1B4 + (Convert.ToInt32(NUP_PartyIndex.Value)-1) * 0x48; + if (offset < 0) return; + int species = BitConverter.ToUInt16(data, offset + 0x00); CB_Species.SelectedValue = species; int item = BitConverter.ToUInt16(data, offset + 0x02);