From 95faf2374e8cde0cb3b62e72cda95d527160dcc9 Mon Sep 17 00:00:00 2001 From: FutureRave Date: Tue, 1 Mar 2022 23:40:35 +0000 Subject: [PATCH] Replace obscure ternary operator with std::min --- src/client/component/bots.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/client/component/bots.cpp b/src/client/component/bots.cpp index d22e219..1a2a0d0 100644 --- a/src/client/component/bots.cpp +++ b/src/client/component/bots.cpp @@ -122,7 +122,9 @@ namespace bots num_bots = atoi(params.get(1)); } - for (auto i = 0; i < (num_bots > *game::mp::svs_numclients ? *game::mp::svs_numclients : num_bots); i++) + num_bots = std::min(num_bots, *game::mp::svs_numclients); + + for (auto i = 0; i < num_bots; i++) { scheduler::once(add_bot, scheduler::pipeline::server, 100ms * i); }