Fractal Softworks Forum

Starsector => Bug Reports & Support => Topic started by: AxleMC131 on May 12, 2017, 12:04:45 AM

Title: [0.8a] Safety overrides reduces weapon ranges past "null" units
Post by: AxleMC131 on May 12, 2017, 12:04:45 AM
Noticed this only today. The description for the Safety Overrides hullmod has an error which causes it to display the bit about reducing weapon range incorrectly, specifically:

"... and drastically reduces weapon ranges past null units."

Traced this back to the hullmod file and found the cause in "getDescriptionParam" (relevant bits highlighted):

Spoiler


...
   public String getDescriptionParam(int index, HullSize hullSize) {
      if (index == 0) return "" + ((Float) speed.get(HullSize.FRIGATE)).intValue();
      if (index == 1) return "" + ((Float) speed.get(HullSize.DESTROYER)).intValue();
      if (index == 2) return "" + ((Float) speed.get(HullSize.CRUISER)).intValue();
      //if (index == 3) return "" + ((Float) speed.get(HullSize.)).intValue();
      if (index == 3) return Misc.getRoundedValue(FLUX_DISSIPATION_MULT);
      if (index == 4) return Misc.getRoundedValue(PEAK_MULT);
      //if (index == 3) return Misc.getRoundedValue(CR_DEG_MULT);
      if (index == 3) return Misc.getRoundedValue(RANGE_THRESHOLD);
//      if (index == 4) return Misc.getRoundedValue(RECOIL_MULT);
      //if (index == 3) return (int)OVERLOAD_DUR + "%";
...


As you can see, between the commented-out bits and the active statements, you've repeated an index value (3). An easy fix, but might want to check on that.

[close]
Title: Re: [0.8a] Safety overrides reduces weapon ranges past "null" units
Post by: Alex on May 12, 2017, 01:32:49 PM
Thanks, was reported a little while back - is fixed!
Title: Re: [0.8a] Safety overrides reduces weapon ranges past "null" units
Post by: AxleMC131 on May 12, 2017, 03:19:14 PM
Thanks, was reported a little while back - is fixed!

Ah, awesome. I didn't know it had already been reported - my apologies.  ;D
Title: Re: [0.8a] Safety overrides reduces weapon ranges past "null" units
Post by: Alex on May 12, 2017, 03:24:34 PM
No worries, would rather have an extra report than no report at all :)
Title: Re: [0.8a] Safety overrides reduces weapon ranges past "null" units
Post by: AxleMC131 on May 12, 2017, 04:15:19 PM
Haha, fair enough! I presume this is fixed for 0.8.1? Cos I don't like messing with stock files, but I might just fix it myself for now.  ;)
Title: Re: [0.8a] Safety overrides reduces weapon ranges past "null" units
Post by: Alex on May 12, 2017, 04:25:01 PM
Yeah, it's fixed for .1.
Title: Re: [0.8a] Safety overrides reduces weapon ranges past "null" units
Post by: AxleMC131 on May 12, 2017, 04:42:41 PM
Yeah, it's fixed for .1.

Sweet. :D