diff --git a/src/lua_script.c b/src/lua_script.c index 85f47e2cb..437fc98a7 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -1093,9 +1093,7 @@ static void ArchiveTables(UINT8 **p) e = ArchiveValue(p, TABLESINDEX, -2); // key should be either a number or a string, ArchiveValue can handle this. if (e == 2) // invalid key type (function, thread, lightuserdata, or anything we don't recognise) { - lua_pushvalue(gL, -2); - CONS_Alert(CONS_ERROR, "Index '%s' (%s) of table %d could not be archived!\n", lua_tostring(gL, -1), luaL_typename(gL, -1), i); - lua_pop(gL, 1); + CONS_Alert(CONS_ERROR, "Index '%s' (%s) of table %d could not be archived!\n", lua_tostring(gL, -2), luaL_typename(gL, -2), i); } else if (e == 3) // nil key due to invalid userdata. NOT an error. { @@ -1111,9 +1109,7 @@ static void ArchiveTables(UINT8 **p) } else if (e == 2) // invalid value type { - lua_pushvalue(gL, -2); - CONS_Alert(CONS_ERROR, "Type of value for table %d entry '%s' (%s) could not be archived!\n", i, lua_tostring(gL, -1), luaL_typename(gL, -1)); - lua_pop(gL, 1); + CONS_Alert(CONS_ERROR, "Type of value for table %d entry '%s' (%s) could not be archived!\n", i, lua_tostring(gL, -2), luaL_typename(gL, -1)); } lua_pop(gL, 1);