ChrisViral / RealChute

Realistic parachutes for KSP
47 stars 38 forks source link

Allow more than 3 decimal places in RealChute GUI to avoid exceptions #78

Closed Gordon-Dry closed 6 years ago

Gordon-Dry commented 6 years ago

This

NullReferenceException: Object reference not set to an instance of an object
  at RealChute.EditorGUI.RenderGUI () [0x00000] in <filename unknown>:0 
  at RealChute.ProceduralChute.OnGUI () [0x00000] in <filename unknown>:0 

is spammed to the log when a generic patch is used to convert a stock parachute into a RealChute. Some values have more than 3 decimal places and so this issue is triggered.

This is how it looks like in VAB:

  1. part info in part list context menu is okay https://i.imgur.com/doDIOj5.png

  2. PAW of seleced part also is okay https://i.imgur.com/sYG4rpm.png

  3. after clicking on "Toggle info" I get this https://i.imgur.com/54Vb9Y2.png

When I choose a part that got a dedicated patch and max. 3 decimal places in the values the issue is gone and the GUI works again.

Gordon-Dry commented 6 years ago

I was able to solve this by doing regex replacement inside the MM patch itself.