Commit ab7ccbc5 by LJ Sonic Committed by James R.

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.
parent 9f54ad4e
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment