mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Handle edge case where aircraft have built in TPGs
This commit is contained in:
parent
b50d82feff
commit
aa2a888ed0
@ -92,6 +92,9 @@ class Loadout:
|
||||
if self.has_weapon_of_type(WeaponType.TGP):
|
||||
return
|
||||
|
||||
if unit_type.has_built_in_target_pod:
|
||||
return
|
||||
|
||||
new_pylons = dict(self.pylons)
|
||||
for pylon_number, weapon in self.pylons.items():
|
||||
if weapon is not None and weapon.weapon_group.type is WeaponType.LGB:
|
||||
|
||||
@ -200,6 +200,11 @@ class AircraftType(UnitType[Type[FlyingType]]):
|
||||
|
||||
task_priorities: dict[FlightType, int]
|
||||
|
||||
# Set to True when aircraft mounts a targeting pod by default i.e. the pod does
|
||||
# not take up a weapons station. If True, do not replace LGBs with dumb bombs
|
||||
# when no TGP is mounted on any station.
|
||||
has_built_in_target_pod: bool
|
||||
|
||||
_by_name: ClassVar[dict[str, AircraftType]] = {}
|
||||
_by_unit_type: ClassVar[dict[type[FlyingType], list[AircraftType]]] = defaultdict(
|
||||
list
|
||||
@ -480,6 +485,7 @@ class AircraftType(UnitType[Type[FlyingType]]):
|
||||
cabin_size=data.get("cabin_size", 10 if aircraft.helicopter else 0),
|
||||
can_carry_crates=data.get("can_carry_crates", aircraft.helicopter),
|
||||
task_priorities=task_priorities,
|
||||
has_built_in_target_pod=data.get("has_built_in_target_pod", False),
|
||||
)
|
||||
|
||||
def __hash__(self) -> int:
|
||||
|
||||
@ -19,3 +19,4 @@ variants:
|
||||
F-117A Nighthawk: {}
|
||||
tasks:
|
||||
Strike: 710
|
||||
has_built_in_target_pod: true
|
||||
|
||||
@ -22,3 +22,4 @@ tasks:
|
||||
OCA/Runway: 630
|
||||
Strike: 640
|
||||
TARCAP: 240
|
||||
has_built_in_target_pod: true
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user