From 2865873e7040222632a6d3aa1573c4ea44d704d5 Mon Sep 17 00:00:00 2001 From: Alam Ed Arias <alam@srb2.org> Date: Sun, 15 Oct 2023 20:35:04 -0400 Subject: [PATCH] Update src/lua_baselib.c No need of counting bots. --- src/lua_baselib.c | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/lua_baselib.c b/src/lua_baselib.c index 4af5066aeb..1d183cdec6 100644 --- a/src/lua_baselib.c +++ b/src/lua_baselib.c @@ -3544,7 +3544,7 @@ static int lib_gAddGametype(lua_State *L) // Partly lifted from Got_AddPlayer static int lib_gAddPlayer(lua_State *L) { - INT16 i, newplayernum, botcount = 1; + INT16 i, newplayernum; player_t *newplayer; SINT8 skinnum = 0, bot; @@ -3552,10 +3552,8 @@ static int lib_gAddPlayer(lua_State *L) { if (!playeringame[i]) break; - - if (players[i].bot) - botcount++; // How many of us are there already? } + if (i >= MAXPLAYERS) { lua_pushnil(L); -- GitLab