|
|
|
@ -73,13 +73,10 @@ class Rat(Unit): |
|
|
|
if self.age < AGE_THRESHOLD: |
|
|
|
if self.age < AGE_THRESHOLD: |
|
|
|
return |
|
|
|
return |
|
|
|
units = [] |
|
|
|
units = [] |
|
|
|
units.extend(self.game.unit_positions.get(self.position, [])) |
|
|
|
|
|
|
|
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_before.get(self.position_before, [])) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
for unit in units: |
|
|
|
for unit in units: |
|
|
|
if unit.id == self.id or unit.age < AGE_THRESHOLD: |
|
|
|
if unit.id == self.id or unit.age < AGE_THRESHOLD or self.position != unit.position_before: |
|
|
|
continue |
|
|
|
continue |
|
|
|
x1, y1, x2, y2 = self.bbox |
|
|
|
x1, y1, x2, y2 = self.bbox |
|
|
|
ox1, oy1, ox2, oy2 = unit.bbox |
|
|
|
ox1, oy1, ox2, oy2 = unit.bbox |
|
|
|
|