Attempt to fix a lua panic when unarchiveing extvars (print error to console instead. Not sure if it would be safe for game to read from save afterwards though)

This commit is contained in:
indev authored and Alug committed 2024-10-12 22:09:51 +02:00
1 parent 23b36b5074
commit 55248e7fcf
1 file changed
+7 -1
+7 -1
View File
@@ -1460,7 +1460,13 @@ static void UnArchiveExtVars(void *pointer)
for (i = 0; i < field_count; i++)
{
READSTRING(save_p, field);
UnArchiveValue(TABLESINDEX);
if (UnArchiveValue(TABLESINDEX) == 1)
{
CONS_Alert(CONS_ERROR, "Unexpected end marker when reading ExtVars (field '%s')\n", field);
break;
}
lua_setfield(gL, -2, field);
}