Update src/lua_baselib.c

No need of counting bots.
This commit is contained in:
Alam Ed Arias 2023-10-15 20:35:04 -04:00
parent de4a8a193b
commit 2865873e70

View file

@ -3544,7 +3544,7 @@ static int lib_gAddGametype(lua_State *L)
// Partly lifted from Got_AddPlayer // Partly lifted from Got_AddPlayer
static int lib_gAddPlayer(lua_State *L) static int lib_gAddPlayer(lua_State *L)
{ {
INT16 i, newplayernum, botcount = 1; INT16 i, newplayernum;
player_t *newplayer; player_t *newplayer;
SINT8 skinnum = 0, bot; SINT8 skinnum = 0, bot;
@ -3552,10 +3552,8 @@ static int lib_gAddPlayer(lua_State *L)
{ {
if (!playeringame[i]) if (!playeringame[i])
break; break;
if (players[i].bot)
botcount++; // How many of us are there already?
} }
if (i >= MAXPLAYERS) if (i >= MAXPLAYERS)
{ {
lua_pushnil(L); lua_pushnil(L);