mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix bug introduced by AI unlimited fuel option
Since the unlimited fuel option would add the option before the threat-reaction option, this result into a false assertion when using EWJ
This commit is contained in:
parent
6e96b4fbb0
commit
93ec459460
@ -121,7 +121,11 @@ class MissionGenerator:
|
||||
@staticmethod
|
||||
def _configure_ewrj(gen: AircraftGenerator) -> None:
|
||||
for groups in gen.ewrj_package_dict.values():
|
||||
optrot = groups[0].points[0].tasks[0]
|
||||
optrot = [
|
||||
task
|
||||
for task in groups[0].points[0].tasks
|
||||
if isinstance(task, OptReactOnThreat)
|
||||
][0]
|
||||
assert isinstance(optrot, OptReactOnThreat)
|
||||
if (
|
||||
len(groups) == 1
|
||||
@ -130,9 +134,13 @@ class MissionGenerator:
|
||||
# primary flight with no EWR-Jamming capability
|
||||
continue
|
||||
for group in groups:
|
||||
group.points[0].tasks[0] = OptReactOnThreat(
|
||||
OptReactOnThreat.Values.PassiveDefense
|
||||
)
|
||||
tasks = group.points[0].tasks
|
||||
for i in range(len(tasks)):
|
||||
if isinstance(tasks[i], OptReactOnThreat):
|
||||
tasks[i] = OptReactOnThreat(
|
||||
OptReactOnThreat.Values.PassiveDefense
|
||||
)
|
||||
break
|
||||
|
||||
def setup_mission_coalitions(self) -> None:
|
||||
self.mission.coalition["blue"] = Coalition(
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
{
|
||||
"nameInUI": "EWR Jammer (for player only)",
|
||||
"nameInUI": "EW Jammer (for player only)",
|
||||
"defaultValue": false,
|
||||
"specificOptions": [
|
||||
{
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user