1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2025-09-19 12:06:07 +08:00

Sync with latest source-sdk-2013.

This commit is contained in:
Nicholas Hastings
2014-10-30 12:30:57 -04:00
parent 6abc7fddca
commit aa5841f220
407 changed files with 6784 additions and 10498 deletions

View File

@ -7710,7 +7710,9 @@ CBaseEntity *CAI_BaseNPC::BestEnemy( void )
if (!pEnemy || !pEnemy->IsAlive())
{
if ( pEnemy )
{
DbgEnemyMsg( this, " %s rejected: dead\n", pEnemy->GetDebugName() );
}
continue;
}
@ -7785,7 +7787,9 @@ CBaseEntity *CAI_BaseNPC::BestEnemy( void )
{
DbgEnemyMsg( this, " %s accepted (1)\n", pEnemy->GetDebugName() );
if ( pBestEnemy )
{
DbgEnemyMsg( this, " (%s displaced)\n", pBestEnemy->GetDebugName() );
}
iBestPriority = IRelationPriority ( pEnemy );
iBestDistSq = (pEnemy->GetAbsOrigin() - GetAbsOrigin() ).LengthSqr();
@ -7799,7 +7803,9 @@ CBaseEntity *CAI_BaseNPC::BestEnemy( void )
{
DbgEnemyMsg( this, " %s accepted\n", pEnemy->GetDebugName() );
if ( pBestEnemy )
{
DbgEnemyMsg( this, " (%s displaced due to priority, %d > %d )\n", pBestEnemy->GetDebugName(), IRelationPriority( pEnemy ), iBestPriority );
}
// this entity is disliked MORE than the entity that we
// currently think is the best visible enemy. No need to do
// a distance check, just get mad at this one for now.
@ -7933,7 +7939,9 @@ CBaseEntity *CAI_BaseNPC::BestEnemy( void )
DbgEnemyMsg( this, " %s accepted\n", pEnemy->GetDebugName() );
if ( pBestEnemy )
{
DbgEnemyMsg( this, " (%s displaced due to distance/visibility)\n", pBestEnemy->GetDebugName() );
}
fBestSeen = fCurSeen;
fBestVisible = fCurVisible;
iBestDistSq = iDistSq;
@ -7942,7 +7950,9 @@ CBaseEntity *CAI_BaseNPC::BestEnemy( void )
bBestUnreachable = bUnreachable;
}
else
{
DbgEnemyMsg( this, " %s rejected: lower priority\n", pEnemy->GetDebugName() );
}
}
DbgEnemyMsg( this, "} == %s\n", pBestEnemy->GetDebugName() );
@ -8033,6 +8043,7 @@ float CAI_BaseNPC::CalcIdealYaw( const Vector &vecTarget )
{
vecProjection.x = -vecTarget.y;
vecProjection.y = vecTarget.x;
vecProjection.z = 0;
return UTIL_VecToYaw( vecProjection - GetLocalOrigin() );
}
@ -8040,6 +8051,7 @@ float CAI_BaseNPC::CalcIdealYaw( const Vector &vecTarget )
{
vecProjection.x = vecTarget.y;
vecProjection.y = vecTarget.x;
vecProjection.z = 0;
return UTIL_VecToYaw( vecProjection - GetLocalOrigin() );
}