Skip to content

Commit

Permalink
Fix #5138 (#5154)
Browse files Browse the repository at this point in the history
  • Loading branch information
kimden authored Aug 13, 2024
1 parent e7dd96a commit 9f1b54d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/network/protocols/server_lobby.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3226,7 +3226,12 @@ void ServerLobby::handleUnencryptedConnection(std::shared_ptr<STKPeer> peer,
unsigned max_players = ServerConfig::m_server_max_players;
// We need to reserve at least 1 slot for new player
if (player_count + ai_add + 1 > max_players)
ai_add = max_players - player_count - 1;
{
if (max_players >= player_count + 1)
ai_add = max_players - player_count - 1;
else
ai_add = 0;
}
for (unsigned i = 0; i < ai_add; i++)
{
#ifdef SERVER_ONLY
Expand Down

0 comments on commit 9f1b54d

Please sign in to comment.