mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Save-compat changes to allow loading Liberation saves
May be incomplete, some discrepancies in naming may still exist, but at least Kerbo's campaign can be loaded.
This commit is contained in:
@@ -17,6 +17,11 @@ _dcs_saved_game_folder: Optional[str] = None
|
||||
|
||||
|
||||
# fmt: off
|
||||
class DummyObject:
|
||||
def __setstate__(self, state):
|
||||
self.__dict__.update(state)
|
||||
|
||||
|
||||
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:
|
||||
@@ -52,6 +57,8 @@ class MigrationUnpickler(pickle.Unpickler):
|
||||
return Thunderstorm
|
||||
if name == "Hipico":
|
||||
return dcs.terrain.falklands.airports.Hipico_Flying_Club
|
||||
if name in ["SaveManager", "SaveGameBundle"]:
|
||||
return DummyObject
|
||||
return super().find_class(module, name)
|
||||
# fmt: on
|
||||
|
||||
|
||||
Reference in New Issue
Block a user