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
|
@staticmethod
|
||||||
def _configure_ewrj(gen: AircraftGenerator) -> None:
|
def _configure_ewrj(gen: AircraftGenerator) -> None:
|
||||||
for groups in gen.ewrj_package_dict.values():
|
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)
|
assert isinstance(optrot, OptReactOnThreat)
|
||||||
if (
|
if (
|
||||||
len(groups) == 1
|
len(groups) == 1
|
||||||
@ -130,9 +134,13 @@ class MissionGenerator:
|
|||||||
# primary flight with no EWR-Jamming capability
|
# primary flight with no EWR-Jamming capability
|
||||||
continue
|
continue
|
||||||
for group in groups:
|
for group in groups:
|
||||||
group.points[0].tasks[0] = OptReactOnThreat(
|
tasks = group.points[0].tasks
|
||||||
|
for i in range(len(tasks)):
|
||||||
|
if isinstance(tasks[i], OptReactOnThreat):
|
||||||
|
tasks[i] = OptReactOnThreat(
|
||||||
OptReactOnThreat.Values.PassiveDefense
|
OptReactOnThreat.Values.PassiveDefense
|
||||||
)
|
)
|
||||||
|
break
|
||||||
|
|
||||||
def setup_mission_coalitions(self) -> None:
|
def setup_mission_coalitions(self) -> None:
|
||||||
self.mission.coalition["blue"] = Coalition(
|
self.mission.coalition["blue"] = Coalition(
|
||||||
|
|||||||
@ -1,5 +1,5 @@
|
|||||||
{
|
{
|
||||||
"nameInUI": "EWR Jammer (for player only)",
|
"nameInUI": "EW Jammer (for player only)",
|
||||||
"defaultValue": false,
|
"defaultValue": false,
|
||||||
"specificOptions": [
|
"specificOptions": [
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user