Expose "server" and "dedicated" to Lua scripts

Careful! Both are local variables and are always false for clients,
and therefore should obviously not be used in anything gamelogic-related.
This commit is contained in:
Louis-Antoine 2020-06-27 15:30:23 +02:00 committed by James R
parent 9f54ad4ea3
commit ab7ccbc5d5

View file

@ -9718,12 +9718,12 @@ static inline int lib_getenum(lua_State *L)
return 0; return 0;
LUA_PushUserdata(L, &players[consoleplayer], META_PLAYER); LUA_PushUserdata(L, &players[consoleplayer], META_PLAYER);
return 1; return 1;
/*} else if (fastcmp(word,"admin")) { } else if (fastcmp(word,"isserver")) {
LUA_Deprecated(L, "admin", "IsPlayerAdmin(player)"); lua_pushboolean(L, server);
if (!playeringame[adminplayers[0]] || IsPlayerAdmin(serverplayer)) return 1;
return 0; } else if (fastcmp(word, "isdedicatedserver")) {
LUA_PushUserdata(L, &players[adminplayers[0]], META_PLAYER); lua_pushboolean(L, dedicated);
return 1;*/ return 1;
} else if (fastcmp(word,"gravity")) { } else if (fastcmp(word,"gravity")) {
lua_pushinteger(L, gravity); lua_pushinteger(L, gravity);
return 1; return 1;