ekolis / stars-nova

Clone of the classic 4X game Stars!. Fork of original svn repo on SourceForge.
Other
17 stars 6 forks source link

decimal truncation glitch #38

Open marhawkman opened 4 years ago

marhawkman commented 4 years ago

Describe the bug I'm not sure how many places this happens but I know at least one. queuecountC It seems to be calculating total YearsToCompletion by adding up the YTC of each item. BUT items with <1 YTC get truncated to 0 YTC, thus when it adds them up it sees the total as 0 YTC. In this example the system has 61 resources, total needed is 75. Thus the actual YTC is 2.

What else does this? I'm not sure since I can't look at the code. But things I've seen where the math has behaved in unexpected ways:
Mining on planets seems to give less than it feels like it should I've seen planets just not produce anything even with 9 or more mines. Population growth, well, there's a side request here, but it feels like pop growth isn't getting rounded properly. Ships will decelerate due to running out of fuel one turn BEFORE they run out of fuel.