fixed rare crashbug in ClientUserInfoChanged

fixed chatter ignores yb_communication_type
fixed waypoint display distance, when host entity is alive
fixed bomber choose most longest route to bombplant (in middle of round).
This commit is contained in:
jeefo 2016-01-05 20:29:34 +03:00
commit 4204f4e9f2
4 changed files with 34 additions and 31 deletions

View file

@ -166,27 +166,27 @@ TacticChoosen:
else if (tactic == 3 && !waypoints.m_goalPoints.IsEmpty ()) // map goal waypoint
{
// force bomber to select closest goal, if round-start goal was reset by something
if (m_hasC4 && g_timeRoundStart + 20.0f < GetWorldTime ())
if (m_hasC4 && g_timeRoundStart + 10.0f < GetWorldTime ())
{
float minDist = 99999999.0f;
float minDist = 99999.0f;
int count = 0;
for (int i = 0; i < g_numWaypoints; i++)
FOR_EACH_AE (waypoints.m_goalPoints, i)
{
Path *path = waypoints.GetPath (i);
Path *path = waypoints.GetPath (waypoints.m_goalPoints[i]);
if (!(path->flags & FLAG_GOAL))
float distance = (path->origin - pev->origin).GetLength ();
if (distance > 1024.0f)
continue;
float distance = (path->origin - pev->origin).GetLengthSquared ();
if (distance < minDist)
{
if (count < 4)
{
goalChoices[count] = i;
count++;
}
goalChoices[count] = i;
if (++count > 3)
count = 0;
minDist = distance;
}
}