From 35a079928969e46d91088563d2b254ac8fe15cad Mon Sep 17 00:00:00 2001 From: INeedBots Date: Mon, 28 Dec 2020 10:29:03 -0600 Subject: [PATCH] bots_main_waitForHostTime --- main_shared/maps/mp/bots/_bot_utility.gsc | 6 +++--- main_shared/maps/mp/gametypes/_bot.gsc | 3 +++ 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/main_shared/maps/mp/bots/_bot_utility.gsc b/main_shared/maps/mp/bots/_bot_utility.gsc index 18be547..b2ebae2 100644 --- a/main_shared/maps/mp/bots/_bot_utility.gsc +++ b/main_shared/maps/mp/bots/_bot_utility.gsc @@ -80,7 +80,7 @@ bot_wait_for_host() while (!isDefined(level) || !isDefined(level.players)) wait 0.05; - for(i = 0; i < 100; i++) + for(i = getDvarFloat("bots_main_waitForHostTime"); i > 0; i -= 0.05) { host = GetHostPlayer(); @@ -93,7 +93,7 @@ bot_wait_for_host() if(!isDefined(host)) return; - for(i = 0; i < 100; i++) + for(i = getDvarFloat("bots_main_waitForHostTime"); i > 0; i -= 0.05) { if(IsDefined( host.pers[ "team" ] )) break; @@ -104,7 +104,7 @@ bot_wait_for_host() if(!IsDefined( host.pers[ "team" ] )) return; - for(i = 0; i < 100; i++) + for(i = getDvarFloat("bots_main_waitForHostTime"); i > 0; i -= 0.05) { if(host.pers[ "team" ] == "allies" || host.pers[ "team" ] == "axis") break; diff --git a/main_shared/maps/mp/gametypes/_bot.gsc b/main_shared/maps/mp/gametypes/_bot.gsc index b600609..cc3510d 100644 --- a/main_shared/maps/mp/gametypes/_bot.gsc +++ b/main_shared/maps/mp/gametypes/_bot.gsc @@ -23,6 +23,9 @@ init() if (!getDvarInt("bots_main")) return; + if(getDvar("bots_main_waitForHostTime") == "") + setDvar("bots_main_waitForHostTime", 10.0);//how long to wait to wait for the host player + if(getDvar("bots_manage_add") == "") setDvar("bots_manage_add", 0);//amount of bots to add to the game if(getDvar("bots_manage_fill") == "")