mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix save-compat issues
This commit is contained in:
parent
666f2908b7
commit
91ee04bf2a
@ -6,6 +6,7 @@ from dcs.countries import countries_by_name
|
||||
|
||||
from game.ato.packagewaypoints import PackageWaypoints
|
||||
from game.data.doctrine import MODERN_DOCTRINE, COLDWAR_DOCTRINE, WWII_DOCTRINE
|
||||
from game.theater import SeasonalConditions
|
||||
|
||||
if TYPE_CHECKING:
|
||||
from game import Game
|
||||
@ -30,6 +31,7 @@ class Migrator:
|
||||
self._update_flights()
|
||||
self._update_squadrons()
|
||||
self._release_untasked_flights()
|
||||
self._update_weather()
|
||||
|
||||
def _update_doctrine(self) -> None:
|
||||
doctrines = [
|
||||
@ -118,3 +120,20 @@ class Migrator:
|
||||
for c in self.game.coalitions:
|
||||
if isinstance(c.faction.country, str):
|
||||
c.faction.country = countries_by_name[c.faction.country]()
|
||||
|
||||
def _update_weather(self):
|
||||
a = self.game.conditions.weather.atmospheric
|
||||
try_set_attr(a, "turbulence_per_10cm", 0.1)
|
||||
sc = self.game.theater.seasonal_conditions
|
||||
self.game.theater.seasonal_conditions = SeasonalConditions(
|
||||
summer_avg_pressure=sc.summer_avg_pressure,
|
||||
winter_avg_pressure=sc.winter_avg_pressure,
|
||||
summer_avg_temperature=sc.summer_avg_temperature,
|
||||
winter_avg_temperature=sc.winter_avg_temperature,
|
||||
temperature_day_night_difference=sc.temperature_day_night_difference,
|
||||
high_avg_yearly_turbulence_per_10cm=1.2,
|
||||
low_avg_yearly_turbulence_per_10cm=0.1,
|
||||
solar_noon_turbulence_per_10cm=0.8,
|
||||
midnight_turbulence_per_10cm=0.4,
|
||||
weather_type_chances=sc.weather_type_chances,
|
||||
)
|
||||
|
||||
@ -36,7 +36,7 @@ class WeatherTypeChances:
|
||||
clear_skies: float
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@dataclass
|
||||
class SeasonalConditions:
|
||||
# Units are inHg and degrees Celsius
|
||||
summer_avg_pressure: float
|
||||
|
||||
@ -5,7 +5,7 @@ from dataclasses import dataclass
|
||||
from game.utils import Pressure
|
||||
|
||||
|
||||
@dataclass(frozen=True)
|
||||
@dataclass
|
||||
class AtmosphericConditions:
|
||||
#: Pressure at sea level.
|
||||
qnh: Pressure
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user