mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
More save-compatibility changes
This commit is contained in:
parent
a9e48770b7
commit
386844378e
@ -95,7 +95,6 @@ class Migrator:
|
||||
def _update_squadrons(self) -> None:
|
||||
for cp in self.game.theater.controlpoints:
|
||||
for s in cp.squadrons:
|
||||
print(s.aircraft, s.aircraft.task_priorities)
|
||||
preferred_task = max(
|
||||
s.aircraft.task_priorities,
|
||||
key=lambda x: s.aircraft.task_priorities[x],
|
||||
|
||||
@ -19,21 +19,37 @@ class MigrationUnpickler(pickle.Unpickler):
|
||||
"""Custom unpickler to migrate campaign save-files for when components have been moved"""
|
||||
def find_class(self, module: Any, name: str) -> Any:
|
||||
if name == "NightMissions":
|
||||
from game.weather.conditions import NightMissions
|
||||
from game.settings import NightMissions
|
||||
return NightMissions
|
||||
if name == "Conditions":
|
||||
from game.weather.conditions import Conditions
|
||||
return Conditions
|
||||
if name == "ClearSkies":
|
||||
from game.weather.conditions import ClearSkies
|
||||
return ClearSkies
|
||||
if name == "AtmosphericConditions":
|
||||
from game.weather.atmosphericconditions import AtmosphericConditions
|
||||
return AtmosphericConditions
|
||||
if name == "WindConditions":
|
||||
from game.weather.wind import WindConditions
|
||||
return WindConditions
|
||||
return super().find_class(module, name)
|
||||
if name == "Clouds":
|
||||
from game.weather.clouds import Clouds
|
||||
return Clouds
|
||||
if name == "ClearSkies":
|
||||
from game.weather.weather import ClearSkies
|
||||
return ClearSkies
|
||||
if name == "Cloudy":
|
||||
from game.weather.weather import Cloudy
|
||||
return Cloudy
|
||||
if name == "Raining":
|
||||
from game.weather.weather import Raining
|
||||
return Raining
|
||||
if name == "Thunderstorm":
|
||||
from game.weather.weather import Thunderstorm
|
||||
return Thunderstorm
|
||||
try:
|
||||
return super().find_class(module, name)
|
||||
except AttributeError:
|
||||
print(module, name)
|
||||
return None
|
||||
# fmt: on
|
||||
|
||||
|
||||
|
||||
@ -2,4 +2,5 @@ description: The An-30M is a military transport aircraft.
|
||||
price: 15
|
||||
variants:
|
||||
An-30M: null
|
||||
tasks: {}
|
||||
tasks:
|
||||
Transport: 150
|
||||
|
||||
@ -28,4 +28,5 @@ role: Strike Fighter
|
||||
max_range: 500
|
||||
variants:
|
||||
MiG-25RBT Foxbat-B: {}
|
||||
tasks: {}
|
||||
tasks:
|
||||
Strike: 150
|
||||
|
||||
@ -5,4 +5,7 @@ can_carry_crates: false
|
||||
variants:
|
||||
SA342Minigun: null
|
||||
kneeboard_units: "metric"
|
||||
tasks: {}
|
||||
tasks:
|
||||
BAI: 230
|
||||
CAS: 230
|
||||
OCA/Aircraft: 230
|
||||
|
||||
@ -20,4 +20,5 @@ role: Light Attack
|
||||
variants:
|
||||
SA 342M Gazelle Mistral: {}
|
||||
kneeboard_units: "metric"
|
||||
tasks: {}
|
||||
tasks:
|
||||
Escort: 80
|
||||
|
||||
@ -2,4 +2,5 @@ price: 15
|
||||
max_range: 200
|
||||
variants:
|
||||
Su-24MR: null
|
||||
tasks: {}
|
||||
tasks:
|
||||
BARCAP: 0
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user