Fix unit position retrieval in Rat class to use correct game state

This commit is contained in:
2025-08-20 16:57:58 +02:00
parent 17e5abc7df
commit 265af1832d
+1 -1
View File
@@ -77,7 +77,7 @@ class Rat(Unit):
return return
units = [] units = []
units.extend(self.game.unit_positions.get(self.position_before, [])) units.extend(self.game.unit_positions.get(self.position_before, []))
units.extend(self.game.unit_positions_before.get(self.position, [])) units.extend(self.game.unit_positions.get(self.position, []))
for unit in units: for unit in units:
if unit.id == self.id or unit.age < AGE_THRESHOLD or self.position != unit.position_before: if unit.id == self.id or unit.age < AGE_THRESHOLD or self.position != unit.position_before: