Jump to content

Pokerus selectedIndex


Favna

Recommended Posts

Reporting this one through a small recording as I do not really know how to describe the bug in words. It occurs even without having loaded any sav, so it's not sav related. The bug is still present in the latest version comitted to the github (2nd of April with commit: Fix hidden power string detection)

The video: http://www.youtube.com/watch?v=PP-fQqGnaoM

To make an attempt in describing with words I'll describe the steps I take:

  1. Fresh start of pkhex
  2. Tick the "infected" box
    Now the "cured" box automatically gets ticked. This shouldn't be the case
  3. Unticking the infected box gives an error.
  4. Hovering mouse over Cured then unticks that box
  5. Manually ticked Cured and then unticking it would theoretically allow for unticking the Infected box
  6. This is not the case. Another error pops up when unticking the Infected box.
  7. Then a chain of Ticking, unticking and more ticking the Cured box finally removes the "days" combo box
  8. Finally, unticking the infected box gives no more errors.


This is the exception text of the first generated error:

************** Exception Text **************System.ArgumentOutOfRangeException: InvalidArgument=Value of '1' is not valid for 'SelectedIndex'.
Parameter name: SelectedIndex
  at System.Windows.Forms.ComboBox.set_SelectedIndex(In  t32 value)
  at PKHeX.Form1.updatePKRSstrain(Object sender, EventArgs e)
  at System.Windows.Forms.ListControl.OnSelectedValueCh  anged(EventArgs e)
  at System.Windows.Forms.ComboBox.OnSelectedValueChang  ed(EventArgs e)
  at System.Windows.Forms.ComboBox.OnSelectedIndexChang  ed(EventArgs e)
  at System.Windows.Forms.ComboBox.set_SelectedIndex(In  t32 value)
  at PKHeX.Form1.updatePKRSCured(Object sender, EventArgs e)
  at System.Windows.Forms.CheckBox.OnCheckedChanged(Eve  ntArgs e)
  at System.Windows.Forms.CheckBox.set_CheckState(Check  State value)
  at System.Windows.Forms.CheckBox.set_Checked(Boolean value)
  at PKHeX.Form1.updatePKRSInfected(Object sender, EventArgs e)
  at System.Windows.Forms.CheckBox.OnCheckedChanged(Eve  ntArgs e)
  at System.Windows.Forms.CheckBox.set_CheckState(Check  State value)
  at System.Windows.Forms.CheckBox.OnClick(EventArgs e)
  at System.Windows.Forms.CheckBox.OnMouseUp(MouseEvent  Args mevent)
  at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
  at System.Windows.Forms.Control.WndProc(Message& m)
  at System.Windows.Forms.ButtonBase.WndProc(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.O  nMessage(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.W  ndProc(Message& m)
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)




************** Loaded Assemblies **************
mscorlib
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
PKHeX
   Assembly Version: 1.0.0.0
   Win32 Version: 1.0.0.0
   CodeBase: file:///D:/User%20Files/Pokemon%20Related/To%20Transfer/PKHaX/PKHeX.exe
----------------------------------------
System.Windows.Forms
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34239 built by: FX452RTMGDR
   CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Configuration
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34230 built by: FX452RTMGDR
   CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------


************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.


For example:


<configuration>
   <system.windows.forms jitDebugging="true" />
</configuration>


And the exception text of the second generated error:

************** Exception Text **************System.ArgumentOutOfRangeException: InvalidArgument=Value of '1' is not valid for 'SelectedIndex'.
Parameter name: SelectedIndex
  at System.Windows.Forms.ComboBox.set_SelectedIndex(In  t32 value)
  at PKHeX.Form1.updatePKRSstrain(Object sender, EventArgs e)
  at System.Windows.Forms.ListControl.OnSelectedValueCh  anged(EventArgs e)
  at System.Windows.Forms.ComboBox.OnSelectedValueChang  ed(EventArgs e)
  at System.Windows.Forms.ComboBox.OnSelectedIndexChang  ed(EventArgs e)
  at System.Windows.Forms.ComboBox.set_SelectedIndex(In  t32 value)
  at PKHeX.Form1.updatePKRSInfected(Object sender, EventArgs e)
  at System.Windows.Forms.CheckBox.OnCheckedChanged(Eve  ntArgs e)
  at System.Windows.Forms.CheckBox.set_CheckState(Check  State value)
  at System.Windows.Forms.CheckBox.OnClick(EventArgs e)
  at System.Windows.Forms.CheckBox.OnMouseUp(MouseEvent  Args mevent)
  at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
  at System.Windows.Forms.Control.WndProc(Message& m)
  at System.Windows.Forms.ButtonBase.WndProc(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.O  nMessage(Message& m)
  at System.Windows.Forms.Control.ControlNativeWindow.W  ndProc(Message& m)
  at System.Windows.Forms.NativeWindow.Callback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)




************** Loaded Assemblies **************
mscorlib
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/Windows/Microsoft.NET/Framework/v4.0.30319/mscorlib.dll
----------------------------------------
PKHeX
   Assembly Version: 1.0.0.0
   Win32 Version: 1.0.0.0
   CodeBase: file:///D:/User%20Files/Pokemon%20Related/To%20Transfer/PKHaX/PKHeX.exe
----------------------------------------
System.Windows.Forms
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Windows.Forms/v4.0_4.0.0.0__b77a5c561934e089/System.Windows.Forms.dll
----------------------------------------
System.Drawing
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Drawing/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Drawing.dll
----------------------------------------
System
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34239 built by: FX452RTMGDR
   CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System/v4.0_4.0.0.0__b77a5c561934e089/System.dll
----------------------------------------
System.Core
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Core/v4.0_4.0.0.0__b77a5c561934e089/System.Core.dll
----------------------------------------
System.Configuration
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Configuration/v4.0_4.0.0.0__b03f5f7f11d50a3a/System.Configuration.dll
----------------------------------------
System.Xml
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34230 built by: FX452RTMGDR
   CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_MSIL/System.Xml/v4.0_4.0.0.0__b77a5c561934e089/System.Xml.dll
----------------------------------------
System.Data
   Assembly Version: 4.0.0.0
   Win32 Version: 4.0.30319.34209 built by: FX452RTMGDR
   CodeBase: file:///C:/WINDOWS/Microsoft.Net/assembly/GAC_32/System.Data/v4.0_4.0.0.0__b77a5c561934e089/System.Data.dll
----------------------------------------


************** JIT Debugging **************
To enable just-in-time (JIT) debugging, the .config file for this
application or computer (machine.config) must have the
jitDebugging value set in the system.windows.forms section.
The application must also be compiled with debugging
enabled.


For example:


<configuration>
   <system.windows.forms jitDebugging="true" />
</configuration>

Link to comment
Share on other sites

Thanks for bringing this up, Favna!

Thanks evandixon for the snippet of code; the problem was actually that not enough day durations were generated (line 1654). Your snippet definitely helped me figure out the root issue quickly!

Even after fixing that there was some weird behavior with the Cured checkbox so I had to fix that as well :)

I've since fixed this in the latest commit.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...