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:
parent
0435acd516
commit
93cc48054a
|
@ -326,6 +326,12 @@ int LUA_PushGlobals(lua_State *L, const char *word)
|
||||||
return 0;
|
return 0;
|
||||||
LUA_PushUserdata(L, &players[secondarydisplayplayer], META_PLAYER);
|
LUA_PushUserdata(L, &players[secondarydisplayplayer], META_PLAYER);
|
||||||
return 1;
|
return 1;
|
||||||
|
} else if (fastcmp(word,"isserver")) {
|
||||||
|
lua_pushboolean(L, server);
|
||||||
|
return 1;
|
||||||
|
} else if (fastcmp(word,"isdedicatedserver")) {
|
||||||
|
lua_pushboolean(L, dedicated);
|
||||||
|
return 1;
|
||||||
// end local player variables
|
// end local player variables
|
||||||
} else if (fastcmp(word,"server")) {
|
} else if (fastcmp(word,"server")) {
|
||||||
if ((!multiplayer || !netgame) && !playeringame[serverplayer])
|
if ((!multiplayer || !netgame) && !playeringame[serverplayer])
|
||||||
|
|
Loading…
Reference in New Issue