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:
|
def _update_squadrons(self) -> None:
|
||||||
for cp in self.game.theater.controlpoints:
|
for cp in self.game.theater.controlpoints:
|
||||||
for s in cp.squadrons:
|
for s in cp.squadrons:
|
||||||
print(s.aircraft, s.aircraft.task_priorities)
|
|
||||||
preferred_task = max(
|
preferred_task = max(
|
||||||
s.aircraft.task_priorities,
|
s.aircraft.task_priorities,
|
||||||
key=lambda x: s.aircraft.task_priorities[x],
|
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"""
|
"""Custom unpickler to migrate campaign save-files for when components have been moved"""
|
||||||
def find_class(self, module: Any, name: str) -> Any:
|
def find_class(self, module: Any, name: str) -> Any:
|
||||||
if name == "NightMissions":
|
if name == "NightMissions":
|
||||||
from game.weather.conditions import NightMissions
|
from game.settings import NightMissions
|
||||||
return NightMissions
|
return NightMissions
|
||||||
if name == "Conditions":
|
if name == "Conditions":
|
||||||
from game.weather.conditions import Conditions
|
from game.weather.conditions import Conditions
|
||||||
return Conditions
|
return Conditions
|
||||||
if name == "ClearSkies":
|
|
||||||
from game.weather.conditions import ClearSkies
|
|
||||||
return ClearSkies
|
|
||||||
if name == "AtmosphericConditions":
|
if name == "AtmosphericConditions":
|
||||||
from game.weather.atmosphericconditions import AtmosphericConditions
|
from game.weather.atmosphericconditions import AtmosphericConditions
|
||||||
return AtmosphericConditions
|
return AtmosphericConditions
|
||||||
if name == "WindConditions":
|
if name == "WindConditions":
|
||||||
from game.weather.wind import WindConditions
|
from game.weather.wind import WindConditions
|
||||||
return 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
|
# fmt: on
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -2,4 +2,5 @@ description: The An-30M is a military transport aircraft.
|
|||||||
price: 15
|
price: 15
|
||||||
variants:
|
variants:
|
||||||
An-30M: null
|
An-30M: null
|
||||||
tasks: {}
|
tasks:
|
||||||
|
Transport: 150
|
||||||
|
|||||||
@ -28,4 +28,5 @@ role: Strike Fighter
|
|||||||
max_range: 500
|
max_range: 500
|
||||||
variants:
|
variants:
|
||||||
MiG-25RBT Foxbat-B: {}
|
MiG-25RBT Foxbat-B: {}
|
||||||
tasks: {}
|
tasks:
|
||||||
|
Strike: 150
|
||||||
|
|||||||
@ -5,4 +5,7 @@ can_carry_crates: false
|
|||||||
variants:
|
variants:
|
||||||
SA342Minigun: null
|
SA342Minigun: null
|
||||||
kneeboard_units: "metric"
|
kneeboard_units: "metric"
|
||||||
tasks: {}
|
tasks:
|
||||||
|
BAI: 230
|
||||||
|
CAS: 230
|
||||||
|
OCA/Aircraft: 230
|
||||||
|
|||||||
@ -20,4 +20,5 @@ role: Light Attack
|
|||||||
variants:
|
variants:
|
||||||
SA 342M Gazelle Mistral: {}
|
SA 342M Gazelle Mistral: {}
|
||||||
kneeboard_units: "metric"
|
kneeboard_units: "metric"
|
||||||
tasks: {}
|
tasks:
|
||||||
|
Escort: 80
|
||||||
|
|||||||
@ -2,4 +2,5 @@ price: 15
|
|||||||
max_range: 200
|
max_range: 200
|
||||||
variants:
|
variants:
|
||||||
Su-24MR: null
|
Su-24MR: null
|
||||||
tasks: {}
|
tasks:
|
||||||
|
BARCAP: 0
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user