mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix naval squadron retreat bug (#567)
This commit is contained in:
parent
e4586add72
commit
121ca20edb
@ -23,6 +23,7 @@
|
||||
* **[Squadrons]** Fixed a bug where loading an air wing config would not properly load all squadrons
|
||||
* **[Flight Plans]** Fixed a bug where SEAD flights would fire one ARM and RTB
|
||||
* **[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
|
||||
|
||||
# Retribution v1.4.1 (hotfix)
|
||||
|
||||
|
||||
@ -8,7 +8,7 @@ from dcs.triggers import TriggerZone
|
||||
from dcs.unittype import ShipType, StaticType, UnitType as DcsUnitType, VehicleType
|
||||
|
||||
from game.data.radar_db import LAUNCHER_TRACKER_PAIRS, TELARS, TRACK_RADARS
|
||||
from game.data.units import ANTI_AIR_UNIT_CLASSES
|
||||
from game.data.units import ANTI_AIR_UNIT_CLASSES, UnitClass
|
||||
from game.dcs.groundunittype import GroundUnitType
|
||||
from game.dcs.shipunittype import ShipUnitType
|
||||
from game.dcs.unittype import UnitType
|
||||
@ -82,9 +82,17 @@ class TheaterUnit:
|
||||
iads = self.ground_object.control_point.coalition.game.theater.iads_network
|
||||
iads.update_tgo(self.ground_object, events)
|
||||
if self.ground_object.is_naval_control_point:
|
||||
cp = self.ground_object.control_point
|
||||
for squadron in cp.squadrons:
|
||||
cp.coalition.air_wing.squadrons[squadron.aircraft].remove(squadron)
|
||||
for unit in self.ground_object.units:
|
||||
if (
|
||||
unit.unit_type
|
||||
and unit.unit_type.unit_class is UnitClass.AIRCRAFT_CARRIER
|
||||
and not unit.alive
|
||||
):
|
||||
cp = self.ground_object.control_point
|
||||
for squadron in cp.squadrons:
|
||||
cp.coalition.air_wing.squadrons[squadron.aircraft].remove(
|
||||
squadron
|
||||
)
|
||||
|
||||
def revive(self, events: GameUpdateEvents) -> None:
|
||||
self.alive = True
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user