mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Avoid moving empty squadrons if aircraft-type can't fit any slot
This commit is contained in:
parent
ef63fe5b5c
commit
245bab57c2
@ -121,13 +121,18 @@ class SquadronDestinationComboBox(QComboBox):
|
|||||||
f"Transfer to {destination} (room for {room} more aircraft)",
|
f"Transfer to {destination} (room for {room} more aircraft)",
|
||||||
destination,
|
destination,
|
||||||
)
|
)
|
||||||
if room < squadron.owned_aircraft:
|
if room < squadron.owned_aircraft or room == 0:
|
||||||
diff = squadron.owned_aircraft - room
|
diff = squadron.owned_aircraft - room
|
||||||
self.setItemText(
|
text = (
|
||||||
idx,
|
|
||||||
f"Transfer to {destination} not possible "
|
f"Transfer to {destination} not possible "
|
||||||
f"({diff} additional slots required)",
|
f"({diff} additional slots required)"
|
||||||
)
|
)
|
||||||
|
if squadron.owned_aircraft == 0 and room == 0:
|
||||||
|
text = (
|
||||||
|
f"Transfer to {destination} not possible "
|
||||||
|
f"(no fitting slots found)"
|
||||||
|
)
|
||||||
|
self.setItemText(idx, text)
|
||||||
self.model().item(idx).setEnabled(False)
|
self.model().item(idx).setEnabled(False)
|
||||||
|
|
||||||
if squadron.destination is None:
|
if squadron.destination is None:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user