mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +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 functools import cached_property
|
||||
from typing import TypeVar, Generic, Type
|
||||
|
||||
from dcs.unittype import UnitType as DcsUnitType
|
||||
@ -19,3 +20,7 @@ class UnitType(Generic[DcsUnitTypeT]):
|
||||
|
||||
def __str__(self) -> str:
|
||||
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
|
||||
def configure_eplrs(group: FlyingGroup, flight: Flight) -> None:
|
||||
if hasattr(flight.unit_type, "eplrs"):
|
||||
if flight.unit_type.dcs_unit_type.eplrs:
|
||||
group.points[0].tasks.append(EPLRS(group.id))
|
||||
if flight.unit_type.eplrs_capable:
|
||||
group.points[0].tasks.append(EPLRS(group.id))
|
||||
|
||||
def configure_cap(
|
||||
self,
|
||||
|
||||
@ -508,7 +508,7 @@ class GroundConflictGenerator:
|
||||
return
|
||||
|
||||
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))
|
||||
|
||||
if group.role == CombatGroupRole.ARTILLERY:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user