mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
fix a bug with parking allocation
This commit is contained in:
parent
96f940bc59
commit
cf575fba2a
@ -26,6 +26,7 @@
|
||||
* **[Plugins]** EW Script - Fix radar detection routine.
|
||||
* **[Campaign]** Fixed a bug where sinking a destroyer in a carrier group would cause squadrons to be removed from the carrier
|
||||
* **[Engine]** Fixed a bug with transfers to Helipads
|
||||
* **[Engine]** Fixed a bug with parking allocation
|
||||
|
||||
# Retribution v1.4.1 (hotfix)
|
||||
|
||||
|
||||
@ -104,6 +104,23 @@ class AircraftGenerator:
|
||||
for parking_slot in cp.parking_slots:
|
||||
parking_slot.unit_id = None
|
||||
|
||||
def _prioritized_packages(self, ato: AirTaskingOrder) -> List[Package]:
|
||||
"""Returns the packages in the order they should be generated."""
|
||||
return sorted(
|
||||
ato.packages,
|
||||
key=lambda p: (
|
||||
(
|
||||
1
|
||||
if any(
|
||||
f.flight_type in [FlightType.AEWC, FlightType.REFUELING]
|
||||
for f in p.flights
|
||||
)
|
||||
else 0
|
||||
),
|
||||
p.time_over_target,
|
||||
),
|
||||
)
|
||||
|
||||
def generate_flights(
|
||||
self,
|
||||
country: Country,
|
||||
@ -124,7 +141,7 @@ class AircraftGenerator:
|
||||
self._reserve_frequencies_and_tacan(ato)
|
||||
self.mission_data.packages.clear()
|
||||
|
||||
for package in reversed(sorted(ato.packages, key=lambda x: x.time_over_target)):
|
||||
for package in reversed(self._prioritized_packages(ato)):
|
||||
logging.info(f"Generating package for target: {package.target.name}")
|
||||
if not package.flights:
|
||||
continue
|
||||
|
||||
@ -33,7 +33,7 @@ pluggy==1.5.0
|
||||
pre-commit==4.2.0
|
||||
pydantic==2.11.0b2
|
||||
pydantic-settings==2.8.1
|
||||
pydcs @ git+https://github.com/dcs-retribution/pydcs@f50627d79c1b24786139eed3a35329d55a03cef5
|
||||
pydcs @ git+https://github.com/dcs-retribution/pydcs@60cddd944d454f59f5c866a2ec2ae3e91526da25
|
||||
pyinstaller==5.13.2
|
||||
pyinstaller-hooks-contrib==2024.0
|
||||
pyparsing==3.2.1
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user