mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Don't generate runway data for heliports.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/2710.
This commit is contained in:
parent
70b9d4c174
commit
c33a0d5deb
@ -18,6 +18,7 @@ Saves from 6.x are not compatible with 7.0.
|
|||||||
|
|
||||||
* **[Data]** Fixed unit ID for the KS-19 AAA. KS-19 would not previously generate correctly in missions. A new game is required for this fix to take effect.
|
* **[Data]** Fixed unit ID for the KS-19 AAA. KS-19 would not previously generate correctly in missions. A new game is required for this fix to take effect.
|
||||||
* **[Flight Planning]** Automatic flight planning will no longer accidentally plan a recovery tanker instead of a theater refueling package. This fixes a potential crash during mission generation when opfor plans a refueling task at a sunk carrier. You'll need to skip the current turn to force opfor to replan their flights to get the fix.
|
* **[Flight Planning]** Automatic flight planning will no longer accidentally plan a recovery tanker instead of a theater refueling package. This fixes a potential crash during mission generation when opfor plans a refueling task at a sunk carrier. You'll need to skip the current turn to force opfor to replan their flights to get the fix.
|
||||||
|
* **[Mission Generation]** Using heliports (airports without any runways) will no longer cause mission generation to fail.
|
||||||
|
|
||||||
# 6.1.0
|
# 6.1.0
|
||||||
|
|
||||||
|
|||||||
@ -878,6 +878,11 @@ class ControlPoint(MissionTarget, SidcDescribable, ABC):
|
|||||||
) -> RunwayData:
|
) -> RunwayData:
|
||||||
...
|
...
|
||||||
|
|
||||||
|
def stub_runway_data(self) -> RunwayData:
|
||||||
|
return RunwayData(
|
||||||
|
self.full_name, runway_heading=Heading.from_degrees(0), runway_name=""
|
||||||
|
)
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def airdrome_id_for_landing(self) -> Optional[int]:
|
def airdrome_id_for_landing(self) -> Optional[int]:
|
||||||
return None
|
return None
|
||||||
@ -1138,6 +1143,14 @@ class Airfield(ControlPoint):
|
|||||||
conditions: Conditions,
|
conditions: Conditions,
|
||||||
dynamic_runways: Dict[str, RunwayData],
|
dynamic_runways: Dict[str, RunwayData],
|
||||||
) -> RunwayData:
|
) -> RunwayData:
|
||||||
|
if not self.airport.runways:
|
||||||
|
# Some airfields are heliports and don't have any runways. This isn't really
|
||||||
|
# the best fix, since we should still try to generate partial data for TACAN
|
||||||
|
# beacons, but it'll do for a bug fix, and the proper fix probably involves
|
||||||
|
# making heliports their own CP type.
|
||||||
|
# https://github.com/dcs-liberation/dcs_liberation/issues/2710
|
||||||
|
return self.stub_runway_data()
|
||||||
|
|
||||||
assigner = RunwayAssigner(conditions)
|
assigner = RunwayAssigner(conditions)
|
||||||
return assigner.get_preferred_runway(theater, self.airport)
|
return assigner.get_preferred_runway(theater, self.airport)
|
||||||
|
|
||||||
@ -1273,8 +1286,6 @@ class Carrier(NavalControlPoint):
|
|||||||
return SymbolSet.SEA_SURFACE, SeaSurfaceEntity.CARRIER
|
return SymbolSet.SEA_SURFACE, SeaSurfaceEntity.CARRIER
|
||||||
|
|
||||||
def mission_types(self, for_player: bool) -> Iterator[FlightType]:
|
def mission_types(self, for_player: bool) -> Iterator[FlightType]:
|
||||||
from game.ato import FlightType
|
|
||||||
|
|
||||||
yield from super().mission_types(for_player)
|
yield from super().mission_types(for_player)
|
||||||
if self.is_friendly(for_player):
|
if self.is_friendly(for_player):
|
||||||
yield from [
|
yield from [
|
||||||
@ -1379,9 +1390,7 @@ class OffMapSpawn(ControlPoint):
|
|||||||
dynamic_runways: Dict[str, RunwayData],
|
dynamic_runways: Dict[str, RunwayData],
|
||||||
) -> RunwayData:
|
) -> RunwayData:
|
||||||
logging.warning("TODO: Off map spawns have no runways.")
|
logging.warning("TODO: Off map spawns have no runways.")
|
||||||
return RunwayData(
|
return self.stub_runway_data()
|
||||||
self.full_name, runway_heading=Heading.from_degrees(0), runway_name=""
|
|
||||||
)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def runway_status(self) -> RunwayStatus:
|
def runway_status(self) -> RunwayStatus:
|
||||||
@ -1423,9 +1432,7 @@ class Fob(ControlPoint):
|
|||||||
dynamic_runways: Dict[str, RunwayData],
|
dynamic_runways: Dict[str, RunwayData],
|
||||||
) -> RunwayData:
|
) -> RunwayData:
|
||||||
logging.warning("TODO: FOBs have no runways.")
|
logging.warning("TODO: FOBs have no runways.")
|
||||||
return RunwayData(
|
return self.stub_runway_data()
|
||||||
self.full_name, runway_heading=Heading.from_degrees(0), runway_name=""
|
|
||||||
)
|
|
||||||
|
|
||||||
@property
|
@property
|
||||||
def runway_status(self) -> RunwayStatus:
|
def runway_status(self) -> RunwayStatus:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user