Skip to content

Commit 9197481

Browse files
committed
Fix corrupted game saves
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.
1 parent 7d57b8d commit 9197481

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/xrGame/alife_registry_container.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,16 +30,16 @@ struct RegistryHelper<TContainer, Loki::Typelist<Head, Tail>>
3030

3131
static void Save(TContainer* self, IWriter& writer)
3232
{
33+
RegistryHelper<TContainer, Tail>::Save(self, writer);
3334
if constexpr (isSerializable)
3435
self->Head::save(writer);
35-
RegistryHelper<TContainer, Tail>::Save(self, writer);
3636
};
3737

3838
static void Load(TContainer* self, IReader& reader)
3939
{
40+
RegistryHelper<TContainer, Tail>::Load(self, reader);
4041
if constexpr (isSerializable)
4142
self->Head::load(reader);
42-
RegistryHelper<TContainer, Tail>::Load(self, reader);
4343
}
4444
};
4545

0 commit comments

Comments
 (0)