Fix floating-point problem

Shame on me for trying to compare floats directly.  I hoped I could get
away with it this once, but I should know better.
This commit is contained in:
Nate Bowman
2026-11-15 20:09:49 -05:00
parent 24a0e9e16b
commit 2fc6b76db4

View File

@@ -233,7 +233,8 @@ class Gather():
else: else:
available = self.gatherable_amounts[task] available = self.gatherable_amounts[task]
if rate == 0 or (villagers == 0 and decay == 0): SMALL_FLOAT = 1e-8
if rate < SMALL_FLOAT or (villagers == 0 and decay == 0):
next_decrease = None next_decrease = None
else: else:
next_decrease = available/(villagers*rate + decay) next_decrease = available/(villagers*rate + decay)