net-lisias-ksp / GPOSpeedPump

Simple automatic resource transfer and balance, for Kerbal Space Program.
GNU General Public License v3.0
2 stars 3 forks source link

FIRST BUG!! NRE on Balance #2

Closed Lisias closed 2 years ago

Lisias commented 2 years ago

This is the first time I tried GPOSP on a staged craft (oh dumbness!), and I got this when trying to balance it:

[ERR 13:41:42.845] Module GPOSpeedPump threw during OnUpdate: System.ArgumentOutOfRangeException: Argument is out of range. Parameter name: index
  at System.Collections.Generic.List`1[PartResource].get_Item (Int32 index) [0x00000] in <filename unknown>:0
  at DictionaryValueList`2[System.Int32,PartResource].At (Int32 index) [0x00000] in <filename unknown>:0
  at PartResourceList.get_Item (Int32 index) [0x00000] in <filename unknown>:0
  at GPOSpeedPump.GPOSpeedPump.Balance () [0x00000] in <filename unknown>:0
  at GPOSpeedPump.GPOSpeedPump.OnUpdate () [0x00000] in <filename unknown>:0
  at Part.ModulesOnUpdate () [0x00000] in <filename unknown>:0
Lisias commented 2 years ago

it was a pretty stupid mistake. bleh. :/

fixed on https://github.com/net-lisias-ksp/GPOSpeedPump/commit/d8d6e39f4435eb1165064247b358326b90eed416