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:
@@ -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
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user