removed useless duck collision

This commit is contained in:
jeefo 2015-07-20 23:18:50 +03:00
commit 714508d6ef
2 changed files with 5 additions and 5 deletions

View file

@ -601,7 +601,7 @@ const int WEAPON_PRIMARY = ((1 << WEAPON_XM1014) | (1 <<WEAPON_M3) | (1 << WEAPO
const int WEAPON_SECONDARY = ((1 << WEAPON_P228) | (1 << WEAPON_ELITE) | (1 << WEAPON_USP) | (1 << WEAPON_GLOCK) | (1 << WEAPON_DEAGLE) | (1 << WEAPON_FIVESEVEN)); const int WEAPON_SECONDARY = ((1 << WEAPON_P228) | (1 << WEAPON_ELITE) | (1 << WEAPON_USP) | (1 << WEAPON_GLOCK) | (1 << WEAPON_DEAGLE) | (1 << WEAPON_FIVESEVEN));
// maximum collide moves // maximum collide moves
const int MAX_COLLIDE_MOVES = 4; const int MAX_COLLIDE_MOVES = 3;
// this structure links waypoints returned from pathfinder // this structure links waypoints returned from pathfinder
struct PathNode struct PathNode

View file

@ -428,7 +428,7 @@ void Bot::CheckTerrain (float movedDistance, const Vector &dirNormal)
else if (IsInWater ()) else if (IsInWater ())
bits |= (PROBE_JUMP | PROBE_STRAFE); bits |= (PROBE_JUMP | PROBE_STRAFE);
else else
bits |= (PROBE_STRAFE | (Random.Long (0, 20) > (cantMoveForward ? 8 : 5) ? PROBE_JUMP : 0) | (Random.Long (0, 100) > (cantMoveForward ? 20 : 5) ? PROBE_DUCK : 0)); bits |= (PROBE_STRAFE | (Random.Long (0, 20) > (cantMoveForward ? 10 : 5) ? PROBE_JUMP : 0));
// collision check allowed if not flying through the air // collision check allowed if not flying through the air
if (IsOnFloor () || IsOnLadder () || IsInWater ()) if (IsOnFloor () || IsOnLadder () || IsInWater ())
@ -440,7 +440,7 @@ void Bot::CheckTerrain (float movedDistance, const Vector &dirNormal)
state[i++] = COLLISION_STRAFELEFT; state[i++] = COLLISION_STRAFELEFT;
state[i++] = COLLISION_STRAFERIGHT; state[i++] = COLLISION_STRAFERIGHT;
state[i++] = COLLISION_JUMP; state[i++] = COLLISION_JUMP;
state[i++] = COLLISION_DUCK; // state[i++] = COLLISION_DUCK;
if (bits & PROBE_STRAFE) if (bits & PROBE_STRAFE)
{ {
@ -3282,9 +3282,9 @@ bool Bot::IsPointOccupied (int index)
int occupyId = GetShootingConeDeviation (bot->GetEntity (), &pev->origin) >= 0.7f ? bot->m_prevWptIndex[0] : m_currentWaypointIndex; int occupyId = GetShootingConeDeviation (bot->GetEntity (), &pev->origin) >= 0.7f ? bot->m_prevWptIndex[0] : m_currentWaypointIndex;
// length check // length check
float length = (waypoint->GetPath (occupyId)->origin - waypoint->GetPath (index)->origin).GetLength (); float length = (waypoint->GetPath (occupyId)->origin - waypoint->GetPath (index)->origin).GetLengthSquared ();
if (occupyId == index || bot->GetTask ()->data == index || length < 96.0f || length < waypoint->GetPath (occupyId)->radius * 0.5f) if (occupyId == index || bot->GetTask ()->data == index || length < GET_SQUARE (64.0f))
return true; return true;
} }
} }