Skip to content

Commit

Permalink
Fix backwards save compatibility with v90 saves
Browse files Browse the repository at this point in the history
- If there is no persistent object table in the savefile, simply skip loading persistent objects.
  • Loading branch information
Web-eWorks committed Mar 16, 2024
1 parent 8b6ae92 commit 241c319
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/lua/LuaSerializer.cpp
Expand Up @@ -413,6 +413,10 @@ void LuaSerializer::LoadPersistent(const Json &json)
lua_State *l = Lua::manager->GetLuaState();
LUA_DEBUG_START(l);

// Old savefile with no persistent table.
if (!json.count("lua_persistent_json"))
return;

const Json &persist = json["lua_persistent_json"];

luaL_getsubtable(l, LUA_REGISTRYINDEX, NS_REFTABLE);
Expand Down

0 comments on commit 241c319

Please sign in to comment.