fixed infinite loop on bad waypoints. now bots will crash down, instead of eating all the ram.
more magic-numbers replacements.
This commit is contained in:
parent
9ae9ecb76a
commit
cd48b98180
7 changed files with 35 additions and 21 deletions
|
|
@ -199,7 +199,6 @@ int BotManager::CreateBot (const String &name, int difficulty, int personality,
|
|||
CenterPrint ("Maximum players reached (%d/%d). Unable to create Bot.", GetMaxClients (), GetMaxClients ());
|
||||
return 2;
|
||||
}
|
||||
|
||||
int index = IndexOfEntity (bot) - 1;
|
||||
|
||||
InternalAssert (index >= 0 && index <= 32); // check index
|
||||
|
|
@ -1079,15 +1078,15 @@ void Bot::NewRound (void)
|
|||
switch (m_personality)
|
||||
{
|
||||
case PERSONALITY_NORMAL:
|
||||
m_pathType = Random.Long (0, 100) > 50 ? 1 : 2;
|
||||
m_pathType = Random.Long (0, 100) > 50 ? SEARCH_PATH_SAFEST_FASTER : SEARCH_PATH_SAFEST;
|
||||
break;
|
||||
|
||||
case PERSONALITY_RUSHER:
|
||||
m_pathType = 0;
|
||||
m_pathType = SEARCH_PATH_FASTEST;
|
||||
break;
|
||||
|
||||
case PERSONALITY_CAREFUL:
|
||||
m_pathType = 2;
|
||||
m_pathType = SEARCH_PATH_SAFEST;
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue