From 7fa4cc5f70a32dcc5bd6aa7d7ba7adfbce849a75 Mon Sep 17 00:00:00 2001 From: jeefo Date: Thu, 14 Mar 2024 14:53:55 +0300 Subject: [PATCH] mgr: fix bot quota overflow when adding manually --- ext/crlib | 2 +- src/manager.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ext/crlib b/ext/crlib index 37d5927..ce3a62a 160000 --- a/ext/crlib +++ b/ext/crlib @@ -1 +1 @@ -Subproject commit 37d592703b23c0762a3fc285d2841da11bb6d525 +Subproject commit ce3a62a810be70ae44385ce15ac8276908856e21 diff --git a/src/manager.cpp b/src/manager.cpp index 9624b64..6eca50c 100644 --- a/src/manager.cpp +++ b/src/manager.cpp @@ -383,7 +383,7 @@ void BotManager::maintainQuota () { const BotCreateResult createResult = create (request.name, request.difficulty, request.personality, request.team, request.skin); if (request.manual) { - cv_quota.set (cv_quota.int_ () + 1); + cv_quota.set (cr::min (cv_quota.int_ () + 1, game.maxClients ())); } // check the result of creation