Page 1 of 1

[0.12.26][Twinsen] Rocket silo % not updated if productivity

Posted: Mon Mar 14, 2016 11:54 pm
by Aardwolf
I noticed a tiny cosmetic bug:

If the rocket silo has productivity modules, and the productivity bar is full, then one would expect the percentage to increase. But it doesn't. But when then the normal green bar is full, the percentage goes +2, so the productivity bonus at least got applied. I think it just doesn't graphically update the percentage.

Re: [0.12.26][Twinsen] Rocket silo % not updated if productivity

Posted: Tue Mar 15, 2016 6:20 pm
by Twinsen
Well, this was interesting.
The problem is not what you described, but it was just that the GUI was skipping 53% (it does not matter if you use productivity or not).

Fixed in 0.12.27.

Re: [0.12.26][Twinsen] Rocket silo % not updated if productivity

Posted: Tue Mar 15, 2016 7:33 pm
by Aardwolf
Ha ha, it was indeed at 53%, awesome :D

Re: [0.12.26][Twinsen] Rocket silo % not updated if productivity

Posted: Mon Mar 21, 2016 8:23 pm
by Rwn
Out of sheer curiosity, what was so special about the number 53 that caused it to be skipped ? :?

Re: [0.12.26][Twinsen] Rocket silo % not updated if productivity

Posted: Tue Mar 22, 2016 3:43 pm
by Twinsen
Rwn wrote:Out of sheer curiosity, what was so special about the number 53 that caused it to be skipped ? :?

Code: Select all

 -     this->launchButton.setText(ssprintf("%u%%", uint32_t(rocketSilo->getRocketFinishedFraction() * 100)));
 +     this->launchButton.setText(ssprintf("%u%%", uint32_t(rocketSilo->getRocketFinishedFraction() * 100.0f + 0.5f)));
This was the line before and after the fix. It was a rounding error. Not exactly sure why 53 was the only one that was rounded badly, but it falls in the category of floating point magic.