david-j-lee / oni-calc

Calculator for Oxygen Not Included
http://onicalc.com
11 stars 4 forks source link

CO2 consumption not calculated for Algae Terrarium #1

Closed asquared31415 closed 6 years ago

asquared31415 commented 6 years ago

When increasing the number of algae terrariums, the used CO2 does not increase in the materials section. This may be intentional, as the terrarium does not need the CO2, but it will use a maximum of 333.33 mg (0.33333 g) per second. This usage is defined in the JSON file for inputs, but does not display for any number of terrariums.

david-j-lee commented 6 years ago

My first GitHub issue! Idk if its a good thing I am so excited to see a bug within my application, lol. Either way, thank for bringing this up. I will look into it.

david-j-lee commented 6 years ago

@asquared31415 I have found the issue. I was rounding my conversion before multiplying against the inputted building quantity. This should now be fixed and is updated to the live site.

asquared31415 commented 6 years ago

I figured it was a rounding issue, as that’s less than half a gram, but I haven’t done much web development and have no clue where any of your logic is for the calculations. I haven’t been able to look at the fix yet, but if you haven’t, I would recommend making sure all of the calculations are done before rounding, not just the terrarium, so if numbers change in the future, and other buildings use fractional grams, it doesn’t break them.