Do not allow selection of non existing carrier in mission planner

This commit is contained in:
Khopa 2020-06-22 12:44:49 +02:00
parent a60ab68287
commit fe02df27a2

View File

@ -16,7 +16,7 @@ class QChooseAirbase(QGroupBox):
self.depart_from_label = QLabel("Airbase : ") self.depart_from_label = QLabel("Airbase : ")
self.depart_from = QComboBox() self.depart_from = QComboBox()
for i, cp in enumerate([b for b in self.game.theater.controlpoints if b.captured]): for i, cp in enumerate([b for b in self.game.theater.controlpoints if b.captured and b.id in self.game.planners]):
self.depart_from.addItem(str(cp.name), cp) self.depart_from.addItem(str(cp.name), cp)
self.depart_from.setCurrentIndex(0) self.depart_from.setCurrentIndex(0)
self.depart_from.currentTextChanged.connect(self._on_airbase_selected) self.depart_from.currentTextChanged.connect(self._on_airbase_selected)