From 3fd3e591e74e708293fd64a59aa09cfd2b8d2dbe Mon Sep 17 00:00:00 2001 From: Vasyl Horbachenko Date: Wed, 4 Jul 2018 01:44:49 +0300 Subject: [PATCH] fixed SAMless start generation --- theater/start_generator.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/theater/start_generator.py b/theater/start_generator.py index f07bf06d..44c628c2 100644 --- a/theater/start_generator.py +++ b/theater/start_generator.py @@ -28,8 +28,8 @@ def generate_initial(theater: ConflictTheater, enemy: str, sams: bool, multiplie variety = int(UNIT_VARIETY) unittypes = db.choose_units(task, importance_factor, variety, enemy) - if not sams: - unittypes = [x for x in unittypes if x not in db.SAM_BAN] + if not sams and task == AirDefence: + unittypes = [x for x in db.find_unittype(AirDefence, enemy) if x not in db.SAM_BAN] count_log = math.log(cp.importance + 0.01, UNIT_COUNT_IMPORTANCE_LOG) count = max(COUNT_BY_TASK[task] * multiplier * (1+count_log), 1)