Skip to content

Commit

Permalink
fix(mission): correct forced airstart
Browse files Browse the repository at this point in the history
closes #78
  • Loading branch information
Wrycu committed Dec 30, 2019
1 parent 9a628da commit 3b3ac41
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions ui/eventmenu.py
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,18 @@ def dampen_count(for_task: typing.Type[Task], unit_type: typing.Type[UnitType],

self.event.player_defending(flights)

slot_count = 0
for flight_details in flights.items():
for flight in flight_details[1:]:
for aircraft in flight.items():
slot_count += aircraft[1][0]
if slot_count > len(self.game.theater.terrain.airports[self.event.from_cp.full_name].parking_slots):
self.error_label["text"] = "You've assigned more aircraft ({}) than the airport has parking for ({})!".format(
slot_count,
len(self.game.theater.terrain.airports[self.event.from_cp.full_name].parking_slots)
)
return

self.game.initiate_event(self.event)
EventResultsMenu(self.window, self.parent, self.game, self.event).display()

0 comments on commit 3b3ac41

Please sign in to comment.