mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix creating new fights to create player pilots.
This is just a hack that automatically converts the assigned pilots to players if needed. This really needs to be replaced with a roster editor like the flight edit screen has, but that also requires squadron selection, which isn't a thing we're ready for yet. https://github.com/dcs-liberation/dcs_liberation/issues/1139
This commit is contained in:
parent
e4e06e0a6e
commit
5a732acf64
@ -1,3 +1,4 @@
|
|||||||
|
import logging
|
||||||
from typing import Optional
|
from typing import Optional
|
||||||
|
|
||||||
from PySide2.QtCore import Qt, Signal
|
from PySide2.QtCore import Qt, Signal
|
||||||
@ -184,7 +185,14 @@ class QFlightCreator(QDialog):
|
|||||||
divert,
|
divert,
|
||||||
custom_name=self.custom_name_text,
|
custom_name=self.custom_name_text,
|
||||||
)
|
)
|
||||||
flight.client_count = self.client_slots_spinner.value()
|
for pilot, idx in zip(flight.pilots, range(self.client_slots_spinner.value())):
|
||||||
|
if pilot is None:
|
||||||
|
logging.error(
|
||||||
|
f"Cannot create client slot because {flight} has no pilot for "
|
||||||
|
f"aircraft {idx}"
|
||||||
|
)
|
||||||
|
continue
|
||||||
|
pilot.player = True
|
||||||
|
|
||||||
# noinspection PyUnresolvedReferences
|
# noinspection PyUnresolvedReferences
|
||||||
self.created.emit(flight)
|
self.created.emit(flight)
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user