Merge pull request #455 from BenCat07/master

fix some backtrack issues
This commit is contained in:
LightCat 2018-05-21 12:37:12 +02:00 committed by GitHub
commit 7f2361c734
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -75,7 +75,14 @@ void Run()
CachedEntity *pEntity = ENTITY(i); CachedEntity *pEntity = ENTITY(i);
if (CE_BAD(pEntity)) if (CE_BAD(pEntity))
{
for (int j = 0; j < 13; j++)
{
headPositions[i][j].hitboxpos = { 0, 0, 0 };
headPositions[i][j].tickcount = 0;
}
continue; continue;
}
if (!pEntity->m_bAlivePlayer) if (!pEntity->m_bAlivePlayer)
{ {
for (int j = 0; j < 13; j++) for (int j = 0; j < 13; j++)
@ -111,7 +118,7 @@ void Run()
for (int t = 0; t < 12; ++t) for (int t = 0; t < 12; ++t)
{ {
Vector ViewDir = angle_vector(cmd->viewangles); Vector ViewDir = angle_vector(cmd->viewangles);
float tempFOV = distance_point_to_line( tempFOV = distance_point_to_line(
headPositions[iBestTarget][t].hitboxpos, headPositions[iBestTarget][t].hitboxpos,
g_pLocalPlayer->v_Eye, ViewDir); g_pLocalPlayer->v_Eye, ViewDir);
if (bestFOV > tempFOV) if (bestFOV > tempFOV)