From 1f19740355eb2a6b0bce756136238708347f5a5c Mon Sep 17 00:00:00 2001 From: Nate Bowman Date: Fri, 6 Nov 2026 19:06:53 -0500 Subject: [PATCH] Fix bug in production queue Queue was losing initial task --- aoe/world.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/aoe/world.py b/aoe/world.py index 75cd9e9..39f5c3c 100644 --- a/aoe/world.py +++ b/aoe/world.py @@ -273,10 +273,10 @@ class World(): while (self.get_effective_population() < pop_space and i < len(self.production_queue)): - thing = self.production_queue[i] + thing, task = self.production_queue[i] if self.housing.check_housing(self, thing) and \ self.production.check_production(self, thing): - self._start_producing(thing) + self._start_producing(thing, task) del self.production_queue[i] else: i += 1 @@ -298,18 +298,18 @@ class World(): i = 0 while i < len(self.production_queue): - thing = self.production_queue[i] + thing, task = self.production_queue[i] if self.production.building[thing] == building and \ self.housing.check_housing(self, thing): - self._start_producing(thing) + self._start_producing(thing, task) del self.production_queue[i] break i += 1 def _use_housing_and_production(self, thing): - self.housing.check_housing(self, thing) self.production.check_production(self, thing) + self.housing.check_housing(self, thing) building = self.production.building[thing] if building is not None: @@ -350,7 +350,7 @@ class World(): try: self._use_housing_and_production(thing) except ProductionBuildingNotAvailableException: - self.production_queue.append(thing) + self.production_queue.append((thing, initial_task)) else: update_time = self.current_time + self.build_times.build_times[thing] self.events[update_time].append((self._add_thing, (thing, initial_task,)))