mirror of
https://github.com/dcs-liberation/dcs_liberation.git
synced 2025-11-10 14:22:26 +00:00
Fix EPLRS for aircraft.
Fixes https://github.com/dcs-liberation/dcs_liberation/issues/1237
This commit is contained in:
parent
a90cb0dad9
commit
5c3bb75786
@ -1,4 +1,5 @@
|
|||||||
from dataclasses import dataclass
|
from dataclasses import dataclass
|
||||||
|
from functools import cached_property
|
||||||
from typing import TypeVar, Generic, Type
|
from typing import TypeVar, Generic, Type
|
||||||
|
|
||||||
from dcs.unittype import UnitType as DcsUnitType
|
from dcs.unittype import UnitType as DcsUnitType
|
||||||
@ -19,3 +20,7 @@ class UnitType(Generic[DcsUnitTypeT]):
|
|||||||
|
|
||||||
def __str__(self) -> str:
|
def __str__(self) -> str:
|
||||||
return self.name
|
return self.name
|
||||||
|
|
||||||
|
@cached_property
|
||||||
|
def eplrs_capable(self) -> bool:
|
||||||
|
return getattr(self.dcs_unit_type, "eplrs", False)
|
||||||
|
|||||||
@ -824,9 +824,8 @@ class AircraftConflictGenerator:
|
|||||||
|
|
||||||
@staticmethod
|
@staticmethod
|
||||||
def configure_eplrs(group: FlyingGroup, flight: Flight) -> None:
|
def configure_eplrs(group: FlyingGroup, flight: Flight) -> None:
|
||||||
if hasattr(flight.unit_type, "eplrs"):
|
if flight.unit_type.eplrs_capable:
|
||||||
if flight.unit_type.dcs_unit_type.eplrs:
|
group.points[0].tasks.append(EPLRS(group.id))
|
||||||
group.points[0].tasks.append(EPLRS(group.id))
|
|
||||||
|
|
||||||
def configure_cap(
|
def configure_cap(
|
||||||
self,
|
self,
|
||||||
|
|||||||
@ -508,7 +508,7 @@ class GroundConflictGenerator:
|
|||||||
return
|
return
|
||||||
|
|
||||||
for dcs_group, group in ally_groups:
|
for dcs_group, group in ally_groups:
|
||||||
if getattr(group.unit_type.dcs_unit_type, "eplrs", False):
|
if group.unit_type.eplrs_capable:
|
||||||
dcs_group.points[0].tasks.append(EPLRS(dcs_group.id))
|
dcs_group.points[0].tasks.append(EPLRS(dcs_group.id))
|
||||||
|
|
||||||
if group.role == CombatGroupRole.ARTILLERY:
|
if group.role == CombatGroupRole.ARTILLERY:
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user