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

@ -2182,25 +2182,13 @@ void Waypoint::SetGoalVisited (int index)
if (index < 0 || index >= g_numWaypoints)
return;
if (!IsGoalVisited (index) || !(m_paths[index]->flags & FLAG_GOAL))
{
#if 0
int bombPoint = FindNearest (GetBombPosition ());
Array <int> markAsVisited;
FindInRadius (markAsVisited, 356.0f, GetPath (index)->origin);
IterateArray (markAsVisited, i)
{
// skip still valid bomb point
if (markAsVisited[i] == bombPoint)
continue;
m_visitedGoals.Push (markAsVisited[i]);
}
#endif
if (!IsGoalVisited (index) && (m_paths[index]->flags & FLAG_GOAL))
m_visitedGoals.Push (index);
}
}
void Waypoint::ClearVisitedGoals (void)
{
m_visitedGoals.RemoveAll ();
}
bool Waypoint::IsGoalVisited (int index)