diff options
| author | Michael Sartain <[email protected]> | 2014-10-02 08:25:55 -0700 |
|---|---|---|
| committer | Michael Sartain <[email protected]> | 2014-10-02 08:25:55 -0700 |
| commit | 55ed12f8d1eb6887d348be03aee5573d44177ffb (patch) | |
| tree | 3686f7ca78c780cd9a3d367b79a9d9250c1be7c0 /mp/src/game/server/ai_basenpc.cpp | |
| parent | * Added support for Visual C++ 2013 Express to VPC (diff) | |
| download | source-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.tar.xz source-sdk-2013-55ed12f8d1eb6887d348be03aee5573d44177ffb.zip | |
Updated the SDK with the latest code from the TF and HL2 branches.
Diffstat (limited to 'mp/src/game/server/ai_basenpc.cpp')
| -rw-r--r-- | mp/src/game/server/ai_basenpc.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/mp/src/game/server/ai_basenpc.cpp b/mp/src/game/server/ai_basenpc.cpp index 1db9eab1..b4442260 100644 --- a/mp/src/game/server/ai_basenpc.cpp +++ b/mp/src/game/server/ai_basenpc.cpp @@ -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() ); } |