give bot some more time to reach destination

so it's should fix problems in de_nuke cloaks
This commit is contained in:
jeefo 2015-07-23 00:01:09 +03:00
commit 0693025f68

View file

@ -5814,22 +5814,22 @@ float Bot::GetEstimatedReachTime (void)
float distance = (waypoint->GetPath (m_prevWptIndex[0])->origin - m_currentPath->origin).GetLength (); float distance = (waypoint->GetPath (m_prevWptIndex[0])->origin - m_currentPath->origin).GetLength ();
// caclulate estimated time // caclulate estimated time
if (pev->maxspeed <= 0.0) if (pev->maxspeed <= 0.0f)
estimatedTime = 4.0 * distance / 240.0; estimatedTime = 4.0f * distance / 240.0f;
else else
estimatedTime = 4.0 * distance / pev->maxspeed; estimatedTime = 4.0f * distance / pev->maxspeed;
// check for special waypoints, that can slowdown our movement // check for special waypoints, that can slowdown our movement
if ((m_currentPath->flags & FLAG_CROUCH) || (m_currentPath->flags & FLAG_LADDER) || (pev->button & IN_DUCK)) if ((m_currentPath->flags & FLAG_CROUCH) || (m_currentPath->flags & FLAG_LADDER) || (pev->button & IN_DUCK))
estimatedTime *= 2.0; estimatedTime *= 3.0f;
// check for too low values // check for too low values
if (estimatedTime < 1.0f) if (estimatedTime < 1.0f)
estimatedTime = 1.0f; estimatedTime = 1.0f;
// check for too high values // check for too high values
if (estimatedTime > 5.0f) if (estimatedTime > 8.0f)
estimatedTime = 5.0f; estimatedTime = 8.0f;
} }
return estimatedTime; return estimatedTime;
} }