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:
|
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)
|
||||||
|
|||||||
Reference in New Issue
Block a user