fixed race-condition in bomb location detection

fixed visited goals are not cleared on round-start
This commit is contained in:
jeefo 2016-01-07 18:49:55 +03:00
commit aeb712c2b3
6 changed files with 45 additions and 25 deletions

View file

@ -587,6 +587,7 @@ void Bot::FindItem (void)
break;
}
}
if (itemExists)
return;
@ -787,7 +788,7 @@ void Bot::FindItem (void)
}
else if (pickupType == PICKUP_PLANTED_C4 && !OutOfBombTimer ())
{
if (m_states & (STATE_SEEING_ENEMY | STATE_SUSPECT_ENEMY))
if (IsValidPlayer (m_enemy))
{
allowPickup = false;
return;
@ -5667,7 +5668,7 @@ Vector Bot::CheckBombAudible (void)
{
// this function checks if bomb is can be heard by the bot, calculations done by manual testing.
if (!g_bombPlanted || (GetTaskId () == TASK_ESCAPEFROMBOMB))
if (!g_bombPlanted || GetTaskId () == TASK_ESCAPEFROMBOMB)
return Vector::GetZero (); // reliability check
if (m_difficulty >= 3)