From 8a4ec56ef50326666d8d0f341a93c26a479ccb51 Mon Sep 17 00:00:00 2001 From: Wolfy Date: Tue, 2 Sep 2014 20:03:02 -0500 Subject: [PATCH] Merge the dedicatedserver and server global variables Previously in Lua, dedicatedserver would only return true if the player running the script was the one hosting the dedicated server. In all other cases, it would return nil. This fixes it to point to the server host no matter what. --- src/dehacked.c | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/src/dehacked.c b/src/dehacked.c index 5149fddd..334179ac 100644 --- a/src/dehacked.c +++ b/src/dehacked.c @@ -8681,12 +8681,7 @@ static inline int lib_getenum(lua_State *L) lua_pushinteger(L, mapmusic); return 1; } else if (fastcmp(word,"server")) { - if (dedicated || !playeringame[serverplayer]) - return 0; - LUA_PushUserdata(L, &players[serverplayer], META_PLAYER); - return 1; - } else if (fastcmp(word,"dedicatedserver")) { - if (!dedicated) + if (!playeringame[serverplayer]) return 0; LUA_PushUserdata(L, &players[serverplayer], META_PLAYER); return 1;