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:
@@ -233,7 +233,8 @@ class Gather():
|
||||
else:
|
||||
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
|
||||
else:
|
||||
next_decrease = available/(villagers*rate + decay)
|
||||
|
||||
Reference in New Issue
Block a user