mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Link landing wpt to pad in flightgroupspawner
Fixes a bug where helipads would try to pop from an empty list
This commit is contained in:
parent
768f2dbc57
commit
51fc0215d6
@ -29,7 +29,6 @@ from game.settings import Settings
|
||||
from game.theater.controlpoint import (
|
||||
Airfield,
|
||||
ControlPoint,
|
||||
Fob,
|
||||
)
|
||||
from game.unitmap import UnitMap
|
||||
from .aircraftpainter import AircraftPainter
|
||||
@ -231,13 +230,6 @@ class AircraftGenerator:
|
||||
).configure()
|
||||
)
|
||||
|
||||
wpt = group.waypoint("LANDING")
|
||||
if flight.is_helo and isinstance(flight.arrival, Fob) and wpt:
|
||||
hpad = self.helipads[flight.arrival].pop(0)
|
||||
wpt.helipad_id = hpad.units[0].id
|
||||
wpt.link_unit = hpad.units[0].id
|
||||
self.helipads[flight.arrival].append(hpad)
|
||||
|
||||
if self.ewrj:
|
||||
self._track_ewrj_flight(flight, group)
|
||||
|
||||
|
||||
@ -9,7 +9,7 @@ from dcs.mission import StartType as DcsStartType
|
||||
from dcs.planes import F_14A, Su_33
|
||||
from dcs.point import PointAction
|
||||
from dcs.ships import KUZNECOW
|
||||
from dcs.terrain import Airport, NoParkingSlotError
|
||||
from dcs.terrain import NoParkingSlotError
|
||||
from dcs.unitgroup import FlyingGroup, ShipGroup, StaticGroup
|
||||
|
||||
from game.ato import Flight
|
||||
@ -310,6 +310,13 @@ class FlightGroupSpawner:
|
||||
group.points[0].action = PointAction.FromGroundAreaHot
|
||||
group.points[0].type = "TakeOffGroundHot"
|
||||
|
||||
wpt = group.waypoint("LANDING")
|
||||
if wpt:
|
||||
hpad = self.helipads[self.flight.arrival].pop(0)
|
||||
wpt.helipad_id = hpad.units[0].id
|
||||
wpt.link_unit = hpad.units[0].id
|
||||
self.helipads[self.flight.arrival].append(hpad)
|
||||
|
||||
for i in range(self.flight.count - 1):
|
||||
try:
|
||||
helipad = self.helipads[cp].pop()
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user