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.
This commit is contained in:
Wolfy 2014-09-02 20:03:02 -05:00 committed by Alam Ed Arias
parent cd1ab74bcd
commit 8a4ec56ef5
1 changed files with 1 additions and 6 deletions

View File

@ -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;