Skip to content

Commit

Permalink
Fix corrupted game saves
Browse files Browse the repository at this point in the history
After refactoring the registry container the registries are saving and loading in incorrect (reverse) order. It leads to loading game tasks registry before map locations registry. But game tasks registry requires data from the map locations registry (map spots, for example) and the game crashes when it can't find the required data.
  • Loading branch information
gunslingermod committed Oct 21, 2018
1 parent 7d57b8d commit 9197481
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/xrGame/alife_registry_container.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -30,16 +30,16 @@ struct RegistryHelper<TContainer, Loki::Typelist<Head, Tail>>

static void Save(TContainer* self, IWriter& writer)
{
RegistryHelper<TContainer, Tail>::Save(self, writer);
if constexpr (isSerializable)
self->Head::save(writer);
RegistryHelper<TContainer, Tail>::Save(self, writer);
};

static void Load(TContainer* self, IReader& reader)
{
RegistryHelper<TContainer, Tail>::Load(self, reader);
if constexpr (isSerializable)
self->Head::load(reader);
RegistryHelper<TContainer, Tail>::Load(self, reader);
}
};

Expand Down

0 comments on commit 9197481

Please sign in to comment.