bots_main_waitForHostTime

This commit is contained in:
INeedBots 2020-12-28 10:29:03 -06:00
parent e8cb198056
commit 35a0799289
2 changed files with 6 additions and 3 deletions

View File

@ -80,7 +80,7 @@ bot_wait_for_host()
while (!isDefined(level) || !isDefined(level.players)) while (!isDefined(level) || !isDefined(level.players))
wait 0.05; wait 0.05;
for(i = 0; i < 100; i++) for(i = getDvarFloat("bots_main_waitForHostTime"); i > 0; i -= 0.05)
{ {
host = GetHostPlayer(); host = GetHostPlayer();
@ -93,7 +93,7 @@ bot_wait_for_host()
if(!isDefined(host)) if(!isDefined(host))
return; return;
for(i = 0; i < 100; i++) for(i = getDvarFloat("bots_main_waitForHostTime"); i > 0; i -= 0.05)
{ {
if(IsDefined( host.pers[ "team" ] )) if(IsDefined( host.pers[ "team" ] ))
break; break;
@ -104,7 +104,7 @@ bot_wait_for_host()
if(!IsDefined( host.pers[ "team" ] )) if(!IsDefined( host.pers[ "team" ] ))
return; 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") if(host.pers[ "team" ] == "allies" || host.pers[ "team" ] == "axis")
break; break;

View File

@ -23,6 +23,9 @@ init()
if (!getDvarInt("bots_main")) if (!getDvarInt("bots_main"))
return; 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") == "") if(getDvar("bots_manage_add") == "")
setDvar("bots_manage_add", 0);//amount of bots to add to the game setDvar("bots_manage_add", 0);//amount of bots to add to the game
if(getDvar("bots_manage_fill") == "") if(getDvar("bots_manage_fill") == "")