From 2fc6b76db45a40f24c8892c42af60069fbe4b491 Mon Sep 17 00:00:00 2001 From: Nate Bowman Date: Sun, 15 Nov 2026 20:09:49 -0500 Subject: [PATCH] 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. --- aoe/gather.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/aoe/gather.py b/aoe/gather.py index 216cad3..975cf03 100644 --- a/aoe/gather.py +++ b/aoe/gather.py @@ -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)