Skip to content

Commit

Permalink
Fix Lua savegame with numbers as name
Browse files Browse the repository at this point in the history
  • Loading branch information
pinguin999 committed Sep 26, 2024
1 parent c32e2a8 commit 0ca31f6
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion src/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -866,7 +866,14 @@ std::string Game::backupLuaTable(const sol::table table, const std::string &pare

if (!parent.empty())
{
k = "[\"" + k + "\"]";
if (key.get_type() == sol::type::string)
{
k = "[\"" + k + "\"]";
}
else if (key.get_type() == sol::type::number)
{
k = "[" + k + "]";
}
}

if (k != "_entry_node" &&
Expand Down

0 comments on commit 0ca31f6

Please sign in to comment.