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
231a8609a1
commit
4ff31ea86d
@ -1,6 +1,7 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import random
|
||||
from datetime import datetime
|
||||
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.missiondata import MissionData, AwacsInfo, TankerInfo
|
||||
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.squadrons import Pilot
|
||||
from .aircraftbehavior import AircraftBehavior
|
||||
@ -210,9 +216,12 @@ class FlightGroupConfigurator:
|
||||
) or isinstance(self.flight.flight_plan, PackageRefuelingFlightPlan):
|
||||
tacan = self.flight.tacan
|
||||
if tacan is None and self.flight.squadron.aircraft.dcs_unit_type.tacan:
|
||||
tacan = self.tacan_registry.alloc_for_band(
|
||||
TacanBand.Y, TacanUsage.AirToAir
|
||||
)
|
||||
try:
|
||||
tacan = self.tacan_registry.alloc_for_band(
|
||||
TacanBand.Y, TacanUsage.AirToAir
|
||||
)
|
||||
except OutOfTacanChannelsError:
|
||||
tacan = random.choice(list(self.tacan_registry.allocated_channels))
|
||||
else:
|
||||
tacan = self.flight.tacan
|
||||
self.mission_data.tankers.append(
|
||||
|
||||
@ -577,6 +577,8 @@ class PretenseAircraftGenerator:
|
||||
from game.pretense.pretenseflightgroupspawner import PretenseFlightGroupSpawner
|
||||
|
||||
"""Creates and configures the flight group in the mission."""
|
||||
if not country.unused_onboard_numbers:
|
||||
country.reset_onboard_numbers()
|
||||
group = PretenseFlightGroupSpawner(
|
||||
flight,
|
||||
country,
|
||||
|
||||
@ -1,7 +1,6 @@
|
||||
from __future__ import annotations
|
||||
|
||||
import logging
|
||||
import os
|
||||
from abc import ABC, abstractmethod
|
||||
from pathlib import Path
|
||||
from typing import TYPE_CHECKING, Optional
|
||||
@ -12,13 +11,11 @@ from dcs.translation import String
|
||||
from dcs.triggers import TriggerStart
|
||||
|
||||
from game.ato import FlightType
|
||||
from game.dcs.aircrafttype import AircraftType
|
||||
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.plugins import LuaPluginManager
|
||||
from game.theater import Airfield, OffMapSpawn
|
||||
from game.utils import escape_string_for_lua
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from game import Game
|
||||
@ -175,14 +172,13 @@ class PretenseLuaGenerator(LuaGenerator):
|
||||
]:
|
||||
tanker_freq = 257.0
|
||||
tanker_tacan = 37.0
|
||||
tanker_variant = "Drogue"
|
||||
for tanker in self.mission_data.tankers:
|
||||
if tanker.group_name == air_group:
|
||||
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":
|
||||
tanker_variant = "Boom"
|
||||
else:
|
||||
tanker_variant = "Drogue"
|
||||
lua_string_zones += (
|
||||
f" presets.missions.{mission_name}:extend"
|
||||
+ "({name='"
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user