Fix swapped list order for purchase priorities.

We were accidentally iterating over the faction list and checking it
against the priority list rather than the other way around, so the
faction's aircraft list was being used for purchase priority rather than
the actual priority list in the game.
This commit is contained in:
Dan Albert
2021-05-18 19:54:39 -07:00
parent a0d9bf0f26
commit c5159f8a87
2 changed files with 2 additions and 1 deletions

View File

@@ -171,7 +171,7 @@ class ProcurementAi:
max_price: float,
) -> Optional[Type[FlyingType]]:
best_choice: Optional[Type[FlyingType]] = None
for unit in [u for u in self.faction.aircrafts if u in types]:
for unit in [u for u in types if u in self.faction.aircrafts]:
if db.PRICES[unit] * number > max_price:
continue
if not airbase.can_operate(unit):