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 authored and James R committed 2020-11-05 20:19:58 -08:00
1 parent 9f54ad4ea3
commit ab7ccbc5d5
1 file changed
+6 -6
+6 -6
View File
@@ -9718,12 +9718,12 @@ static inline int lib_getenum(lua_State *L)
return 0;
LUA_PushUserdata(L, &players[consoleplayer], META_PLAYER);
return 1;
/*} else if (fastcmp(word,"admin")) {
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,"isserver")) {
lua_pushboolean(L, server);
return 1;
} else if (fastcmp(word, "isdedicatedserver")) {
lua_pushboolean(L, dedicated);
return 1;
} else if (fastcmp(word,"gravity")) {
lua_pushinteger(L, gravity);
return 1;