From 9177588220477e4544c9bfec0d2927a0dcd01a86 Mon Sep 17 00:00:00 2001 From: Dan Albert Date: Tue, 13 Jul 2021 20:49:31 -0700 Subject: [PATCH] Don't target ammo depots at inactive front lines. --- game/commander/tasks/compound/attackbuildings.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/game/commander/tasks/compound/attackbuildings.py b/game/commander/tasks/compound/attackbuildings.py index fe80dbf0..21e9a652 100644 --- a/game/commander/tasks/compound/attackbuildings.py +++ b/game/commander/tasks/compound/attackbuildings.py @@ -7,5 +7,9 @@ from game.htn import CompoundTask, Method class AttackBuildings(CompoundTask[TheaterState]): def each_valid_method(self, state: TheaterState) -> Iterator[Method[TheaterState]]: - for garrison in state.strike_targets: - yield [PlanStrike(garrison)] + for building in state.strike_targets: + # Ammo depots are targeted based on the needs of the front line by + # ReduceEnemyFrontLineCapacity. No reason to target them before that front + # line is active. + if not building.is_ammo_depot: + yield [PlanStrike(building)]