From a9b35a6f7a68d7dfd2e0df907b628f8bc3135a1f Mon Sep 17 00:00:00 2001
From: LJ Sonic <lamr@free.fr>
Date: Tue, 10 Aug 2021 00:15:44 +0200
Subject: [PATCH] Fix incorrect error message during Lua archiving

---
 src/lua_script.c | 10 +---------
 1 file changed, 1 insertion(+), 9 deletions(-)

diff --git a/src/lua_script.c b/src/lua_script.c
index 9eb1912b32..25e0a8f37b 100644
--- a/src/lua_script.c
+++ b/src/lua_script.c
@@ -1384,21 +1384,13 @@ static void ArchiveTables(void)
 			// Write key
 			e = ArchiveValue(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);
 			// Write value
 			e = ArchiveValue(TABLESINDEX, -1);
 			if (e == 1)
 				n++; // the table contained a new table we'll have to archive. :(
 			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);
-			}
 
 			lua_pop(gL, 1);
 		}
-- 
GitLab