mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix naval aircraft not always returning to carrier
This commit is contained in:
parent
d6026681ee
commit
bc26eb3f5e
@ -46,6 +46,7 @@
|
||||
* **[Mission Generation]** Fix infinite loop when using "Fast-Forward to first contact"
|
||||
* **[Capture Logic]** Release all parking slots when an airbase is captured
|
||||
* **[Modding]** Swedish Military Assets Pack air defence presets are now correctly removed from the faction when the mod is disabled.
|
||||
* **[Mission Generation]** Naval aircraft not always returning to carrier
|
||||
|
||||
# Retribution v1.2.1 (hotfix)
|
||||
|
||||
|
||||
@ -1,5 +1,6 @@
|
||||
from dcs.point import MovingPoint, PointAction
|
||||
|
||||
from game.theater import NavalControlPoint
|
||||
from .pydcswaypointbuilder import PydcsWaypointBuilder
|
||||
|
||||
|
||||
@ -9,5 +10,9 @@ class LandingPointBuilder(PydcsWaypointBuilder):
|
||||
waypoint.type = "Land"
|
||||
waypoint.action = PointAction.Landing
|
||||
if (control_point := self.waypoint.control_point) is not None:
|
||||
waypoint.airdrome_id = control_point.airdrome_id_for_landing
|
||||
if isinstance(control_point, NavalControlPoint):
|
||||
waypoint.helipad_id = control_point.airdrome_id_for_landing
|
||||
waypoint.link_unit = control_point.airdrome_id_for_landing
|
||||
else:
|
||||
waypoint.airdrome_id = control_point.airdrome_id_for_landing
|
||||
return waypoint
|
||||
|
||||
@ -590,6 +590,7 @@ class GenericCarrierGenerator(GroundObjectGenerator):
|
||||
f"Error generating carrier group for {self.control_point.name}"
|
||||
)
|
||||
ship_group.units[0].type = carrier_type.id
|
||||
self.control_point.carrier_id = ship_group.units[0].id
|
||||
if self.control_point.tacan is None:
|
||||
tacan = self.tacan_registry.alloc_for_band(
|
||||
TacanBand.X, TacanUsage.TransmitReceive
|
||||
|
||||
@ -1336,6 +1336,8 @@ class Airfield(ControlPoint, CTLD):
|
||||
class NavalControlPoint(
|
||||
ControlPoint, ABC, Link4Container, TacanContainer, ICLSContainer
|
||||
):
|
||||
carrier_id: Optional[int] = None
|
||||
|
||||
@property
|
||||
def is_fleet(self) -> bool:
|
||||
return True
|
||||
@ -1427,6 +1429,10 @@ class NavalControlPoint(
|
||||
return ControlPointStatus.Damaged
|
||||
return ControlPointStatus.Functional
|
||||
|
||||
@property
|
||||
def airdrome_id_for_landing(self) -> Optional[int]:
|
||||
return self.carrier_id
|
||||
|
||||
|
||||
class Carrier(NavalControlPoint):
|
||||
def __init__(
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user