mirror of
https://github.com/ineedbots/iw5_bot_warfare.git
synced 2025-04-26 07:34:50 +00:00
Fixed bots changing classes
This commit is contained in:
parent
022496a9ca
commit
47d08a7cfc
@ -38,6 +38,7 @@ connected()
|
|||||||
|
|
||||||
self.killerLocation = undefined;
|
self.killerLocation = undefined;
|
||||||
self.lastKiller = undefined;
|
self.lastKiller = undefined;
|
||||||
|
self.bot_change_class = true;
|
||||||
|
|
||||||
self thread difficulty();
|
self thread difficulty();
|
||||||
self thread teamWatch();
|
self thread teamWatch();
|
||||||
@ -480,10 +481,10 @@ chooseRandomPerk( perkkind )
|
|||||||
if ( perkkind == "perk4" )
|
if ( perkkind == "perk4" )
|
||||||
return "specialty_null";
|
return "specialty_null";
|
||||||
|
|
||||||
if (perk == "specialty_coldblooded" || perk == "specialty_blindeye" || perk == "specialty_quieter")
|
if ( perk == "specialty_coldblooded" || perk == "specialty_blindeye" || perk == "specialty_quieter" )
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
if (perk == "streaktype_specialist" || perk == "streaktype_support")
|
if ( perk == "streaktype_specialist" || perk == "streaktype_support" )
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1193,10 +1194,12 @@ classWatch()
|
|||||||
|
|
||||||
wait 0.5;
|
wait 0.5;
|
||||||
|
|
||||||
self notify( "menuresponse", game["menu_changeclass"], self chooseRandomClass() );
|
if ( !isValidClass( self.class ) || !isDefined( self.bot_change_class ) )
|
||||||
|
self notify( "menuresponse", game["menu_changeclass"], self chooseRandomClass() );
|
||||||
|
|
||||||
self.bot_change_class = true;
|
self.bot_change_class = true;
|
||||||
|
|
||||||
while ( isdefined( self.pers["team"] ) && isdefined( self.pers["class"] ) && isDefined( self.bot_change_class ) )
|
while ( isdefined( self.pers["team"] ) && isValidClass( self.class ) && isDefined( self.bot_change_class ) )
|
||||||
wait .05;
|
wait .05;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -1262,8 +1265,10 @@ teamWatch()
|
|||||||
while ( !isdefined( self.pers["team"] ) || !allowTeamChoice() )
|
while ( !isdefined( self.pers["team"] ) || !allowTeamChoice() )
|
||||||
wait .05;
|
wait .05;
|
||||||
|
|
||||||
wait 0.05;
|
wait 0.1;
|
||||||
self notify( "menuresponse", game["menu_team"], getDvar( "bots_team" ) );
|
|
||||||
|
if ( self.team != "axis" || self.team != "allies" )
|
||||||
|
self notify( "menuresponse", game["menu_team"], getDvar( "bots_team" ) );
|
||||||
|
|
||||||
while ( isdefined( self.pers["team"] ) )
|
while ( isdefined( self.pers["team"] ) )
|
||||||
wait .05;
|
wait .05;
|
||||||
@ -6314,7 +6319,8 @@ bot_cap()
|
|||||||
getCarrierEntNum()
|
getCarrierEntNum()
|
||||||
{
|
{
|
||||||
carrierNum = -1;
|
carrierNum = -1;
|
||||||
if (isDefined(self.carrier))
|
|
||||||
|
if ( isDefined( self.carrier ) )
|
||||||
carrierNum = self.carrier getEntityNumber();
|
carrierNum = self.carrier getEntityNumber();
|
||||||
|
|
||||||
return carrierNum;
|
return carrierNum;
|
||||||
@ -6959,7 +6965,7 @@ bot_think_revive_loop()
|
|||||||
|
|
||||||
self.bot_lock_goal = false;
|
self.bot_lock_goal = false;
|
||||||
|
|
||||||
if ( ret != "goal" || !isDefined(revive) || distanceSquared(self.origin, revive.origin) >= 100 * 100 || !revive inLastStand() || revive isBeingRevived() || !isAlive(revive) )
|
if ( ret != "goal" || !isDefined( revive ) || distanceSquared( self.origin, revive.origin ) >= 100 * 100 || !revive inLastStand() || revive isBeingRevived() || !isAlive( revive ) )
|
||||||
return;
|
return;
|
||||||
|
|
||||||
waitTime = 3.25;
|
waitTime = 3.25;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user