mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Blast through errors
This commit is contained in:
parent
087a38d105
commit
a30fb0f368
@ -1,6 +1,7 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
|
import random
|
||||||
from datetime import datetime
|
from datetime import datetime
|
||||||
from typing import Any, Optional, TYPE_CHECKING
|
from typing import Any, Optional, TYPE_CHECKING
|
||||||
|
|
||||||
@ -19,7 +20,12 @@ from game.data.weapons import Pylon, WeaponType
|
|||||||
from game.missiongenerator.logisticsgenerator import LogisticsGenerator
|
from game.missiongenerator.logisticsgenerator import LogisticsGenerator
|
||||||
from game.missiongenerator.missiondata import MissionData, AwacsInfo, TankerInfo
|
from game.missiongenerator.missiondata import MissionData, AwacsInfo, TankerInfo
|
||||||
from game.radio.radios import RadioFrequency, RadioRegistry
|
from game.radio.radios import RadioFrequency, RadioRegistry
|
||||||
from game.radio.tacan import TacanBand, TacanRegistry, TacanUsage
|
from game.radio.tacan import (
|
||||||
|
TacanBand,
|
||||||
|
TacanRegistry,
|
||||||
|
TacanUsage,
|
||||||
|
OutOfTacanChannelsError,
|
||||||
|
)
|
||||||
from game.runways import RunwayData
|
from game.runways import RunwayData
|
||||||
from game.squadrons import Pilot
|
from game.squadrons import Pilot
|
||||||
from .aircraftbehavior import AircraftBehavior
|
from .aircraftbehavior import AircraftBehavior
|
||||||
@ -210,9 +216,12 @@ class FlightGroupConfigurator:
|
|||||||
) or isinstance(self.flight.flight_plan, PackageRefuelingFlightPlan):
|
) or isinstance(self.flight.flight_plan, PackageRefuelingFlightPlan):
|
||||||
tacan = self.flight.tacan
|
tacan = self.flight.tacan
|
||||||
if tacan is None and self.flight.squadron.aircraft.dcs_unit_type.tacan:
|
if tacan is None and self.flight.squadron.aircraft.dcs_unit_type.tacan:
|
||||||
tacan = self.tacan_registry.alloc_for_band(
|
try:
|
||||||
TacanBand.Y, TacanUsage.AirToAir
|
tacan = self.tacan_registry.alloc_for_band(
|
||||||
)
|
TacanBand.Y, TacanUsage.AirToAir
|
||||||
|
)
|
||||||
|
except OutOfTacanChannelsError:
|
||||||
|
tacan = random.choice(list(self.tacan_registry.allocated_channels))
|
||||||
else:
|
else:
|
||||||
tacan = self.flight.tacan
|
tacan = self.flight.tacan
|
||||||
self.mission_data.tankers.append(
|
self.mission_data.tankers.append(
|
||||||
|
|||||||
@ -577,6 +577,8 @@ class PretenseAircraftGenerator:
|
|||||||
from game.pretense.pretenseflightgroupspawner import PretenseFlightGroupSpawner
|
from game.pretense.pretenseflightgroupspawner import PretenseFlightGroupSpawner
|
||||||
|
|
||||||
"""Creates and configures the flight group in the mission."""
|
"""Creates and configures the flight group in the mission."""
|
||||||
|
if not country.unused_onboard_numbers:
|
||||||
|
country.reset_onboard_numbers()
|
||||||
group = PretenseFlightGroupSpawner(
|
group = PretenseFlightGroupSpawner(
|
||||||
flight,
|
flight,
|
||||||
country,
|
country,
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
from __future__ import annotations
|
from __future__ import annotations
|
||||||
|
|
||||||
import logging
|
import logging
|
||||||
import os
|
|
||||||
from abc import ABC, abstractmethod
|
from abc import ABC, abstractmethod
|
||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
from typing import TYPE_CHECKING, Optional
|
from typing import TYPE_CHECKING, Optional
|
||||||
@ -12,13 +11,11 @@ from dcs.translation import String
|
|||||||
from dcs.triggers import TriggerStart
|
from dcs.triggers import TriggerStart
|
||||||
|
|
||||||
from game.ato import FlightType
|
from game.ato import FlightType
|
||||||
from game.dcs.aircrafttype import AircraftType
|
|
||||||
from game.missiongenerator.luagenerator import LuaGenerator
|
from game.missiongenerator.luagenerator import LuaGenerator
|
||||||
from game.plugins import LuaPluginManager
|
|
||||||
from game.theater import TheaterGroundObject, Airfield, OffMapSpawn
|
|
||||||
from game.theater.iadsnetwork.iadsrole import IadsRole
|
|
||||||
from game.utils import escape_string_for_lua
|
|
||||||
from game.missiongenerator.missiondata import MissionData
|
from game.missiongenerator.missiondata import MissionData
|
||||||
|
from game.plugins import LuaPluginManager
|
||||||
|
from game.theater import Airfield, OffMapSpawn
|
||||||
|
from game.utils import escape_string_for_lua
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from game import Game
|
from game import Game
|
||||||
@ -175,14 +172,13 @@ class PretenseLuaGenerator(LuaGenerator):
|
|||||||
]:
|
]:
|
||||||
tanker_freq = 257.0
|
tanker_freq = 257.0
|
||||||
tanker_tacan = 37.0
|
tanker_tacan = 37.0
|
||||||
|
tanker_variant = "Drogue"
|
||||||
for tanker in self.mission_data.tankers:
|
for tanker in self.mission_data.tankers:
|
||||||
if tanker.group_name == air_group:
|
if tanker.group_name == air_group:
|
||||||
tanker_freq = tanker.freq.hertz / 1000000
|
tanker_freq = tanker.freq.hertz / 1000000
|
||||||
tanker_tacan = tanker.tacan.number
|
tanker_tacan = tanker.tacan if tanker.tacan else "N/A"
|
||||||
if tanker.variant == "KC-135 Stratotanker":
|
if tanker.variant == "KC-135 Stratotanker":
|
||||||
tanker_variant = "Boom"
|
tanker_variant = "Boom"
|
||||||
else:
|
|
||||||
tanker_variant = "Drogue"
|
|
||||||
lua_string_zones += (
|
lua_string_zones += (
|
||||||
f" presets.missions.{mission_name}:extend"
|
f" presets.missions.{mission_name}:extend"
|
||||||
+ "({name='"
|
+ "({name='"
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user