From 2c9ea284a7b2758c8bce40e4eb679a5599864a0d Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 12 Jan 2020 20:04:05 -0800 Subject: [PATCH 1/2] Kill Lua adminplayer --- src/lua_script.c | 6 ------ 1 file changed, 6 deletions(-) diff --git a/src/lua_script.c b/src/lua_script.c index eb1afaf09..2538fb711 100644 --- a/src/lua_script.c +++ b/src/lua_script.c @@ -274,12 +274,6 @@ int LUA_PushGlobals(lua_State *L, const char *word) return 0; LUA_PushUserdata(L, &players[serverplayer], META_PLAYER); return 1; - } else if (fastcmp(word,"admin")) { // BACKWARDS COMPATIBILITY HACK: This was replaced with IsPlayerAdmin(), but some 2.1 Lua scripts still use the admin variable. It now points to the first admin player in the array. - LUA_Deprecated(L, "admin", "IsPlayerAdmin(player)"); - if (!playeringame[adminplayers[0]] || IsPlayerAdmin(serverplayer)) - return 0; - LUA_PushUserdata(L, &players[adminplayers[0]], META_PLAYER); - return 1; } else if (fastcmp(word,"emeralds")) { lua_pushinteger(L, emeralds); return 1; From b3afa91673456cf43ef7d32ff8d327cc67b93bff Mon Sep 17 00:00:00 2001 From: James R Date: Sun, 12 Jan 2020 20:21:35 -0800 Subject: [PATCH 2/2] Remove adminplayer from SERVERINFO (PACKETVERSION 2) --- src/d_clisrv.h | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/d_clisrv.h b/src/d_clisrv.h index 5bd5e5d98..408d0f8dd 100644 --- a/src/d_clisrv.h +++ b/src/d_clisrv.h @@ -27,7 +27,7 @@ This version is independent of the mod name, and standard version and subversion. It should only account for the basic fields of the packet, and change infrequently. */ -#define PACKETVERSION 1 +#define PACKETVERSION 2 // Network play related stuff. // There is a data struct that stores network @@ -366,7 +366,6 @@ typedef struct UINT8 cheatsenabled; UINT8 isdedicated; UINT8 fileneedednum; - SINT8 adminplayer; tic_t time; tic_t leveltime; char servername[MAXSERVERNAME];