mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix zombie carrier
Fixed (zombie) carrier killed in state.json but always respawning in-game, issue #2405. GenericCarrierGenerator.generate() will now generate the ship group with an array that only contains alive ship units, just like GroundObjectGenerator.generate() has previously done. Carrier groups will now also show up as destroyed/damaged on the map when the carrier is sunk.
This commit is contained in:
parent
d08adc2842
commit
da04abf53a
@ -373,7 +373,17 @@ class GenericCarrierGenerator(GroundObjectGenerator):
|
||||
logging.warning(f"Found empty carrier group in {self.control_point}")
|
||||
continue
|
||||
|
||||
ship_group = self.create_ship_group(group.group_name, group.units, atc)
|
||||
ship_units = []
|
||||
for unit in group.units:
|
||||
if unit.alive:
|
||||
# All alive Ships
|
||||
ship_units.append(unit)
|
||||
|
||||
if not ship_units:
|
||||
# Empty array (no alive units), skip this group
|
||||
continue
|
||||
|
||||
ship_group = self.create_ship_group(group.group_name, ship_units, atc)
|
||||
|
||||
# Always steam into the wind, even if the carrier is being moved.
|
||||
# There are multiple unsimulated hours between turns, so we can
|
||||
@ -382,7 +392,7 @@ class GenericCarrierGenerator(GroundObjectGenerator):
|
||||
brc = self.steam_into_wind(ship_group)
|
||||
|
||||
# Set Carrier Specific Options
|
||||
if g_id == 0:
|
||||
if g_id == 0 and self.control_point.runway_is_operational():
|
||||
# Get Correct unit type for the carrier.
|
||||
# This will upgrade to super carrier if option is enabled
|
||||
carrier_type = self.carrier_type
|
||||
|
||||
@ -1195,7 +1195,7 @@ class NavalControlPoint(ControlPoint, ABC):
|
||||
# while its escorts are still alive.
|
||||
for group in self.find_main_tgo().groups:
|
||||
for u in group.units:
|
||||
if u.type in [
|
||||
if u.alive and u.type in [
|
||||
Forrestal,
|
||||
Stennis,
|
||||
LHA_Tarawa,
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user