mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-09-19 20:16:10 +08:00
Fixed conflict between min/max macros and std::min/max when using GCC >= 4.2.
This commit is contained in:
@ -790,11 +790,11 @@ bool CAI_BaseNPC::FindCoverPos( CSound *pSound, Vector *pResult )
|
||||
{
|
||||
if ( !GetTacticalServices()->FindCoverPos( pSound->GetSoundReactOrigin(),
|
||||
pSound->GetSoundReactOrigin(),
|
||||
min( pSound->Volume(), 120.0 ),
|
||||
MIN( pSound->Volume(), 120.0 ),
|
||||
CoverRadius(),
|
||||
pResult ) )
|
||||
{
|
||||
return GetTacticalServices()->FindLateralCover( pSound->GetSoundReactOrigin(), min( pSound->Volume(), 60.0 ), pResult );
|
||||
return GetTacticalServices()->FindLateralCover( pSound->GetSoundReactOrigin(), MIN( pSound->Volume(), 60.0 ), pResult );
|
||||
}
|
||||
|
||||
return true;
|
||||
@ -1732,7 +1732,7 @@ void CAI_BaseNPC::StartTask( const Task_t *pTask )
|
||||
{
|
||||
if ( GetActiveWeapon() && GetEnemy() )
|
||||
{
|
||||
float range = max( GetActiveWeapon()->m_fMaxRange1, GetActiveWeapon()->m_fMaxRange2 );
|
||||
float range = MAX( GetActiveWeapon()->m_fMaxRange1, GetActiveWeapon()->m_fMaxRange2 );
|
||||
if ( pTask->flTaskData != 0 && pTask->flTaskData < range )
|
||||
range = pTask->flTaskData;
|
||||
float dist = EnemyDistance( GetEnemy() );
|
||||
@ -1763,8 +1763,8 @@ void CAI_BaseNPC::StartTask( const Task_t *pTask )
|
||||
|
||||
if ( GetActiveWeapon() )
|
||||
{
|
||||
flMaxRange = max( GetActiveWeapon()->m_fMaxRange1, GetActiveWeapon()->m_fMaxRange2 );
|
||||
flMinRange = min( GetActiveWeapon()->m_fMinRange1, GetActiveWeapon()->m_fMinRange2 );
|
||||
flMaxRange = MAX( GetActiveWeapon()->m_fMaxRange1, GetActiveWeapon()->m_fMaxRange2 );
|
||||
flMinRange = MIN( GetActiveWeapon()->m_fMinRange1, GetActiveWeapon()->m_fMinRange2 );
|
||||
}
|
||||
|
||||
//Check against NPC's max range
|
||||
@ -1903,8 +1903,8 @@ void CAI_BaseNPC::StartTask( const Task_t *pTask )
|
||||
|
||||
if ( GetActiveWeapon() )
|
||||
{
|
||||
flMaxRange = max( GetActiveWeapon()->m_fMaxRange1, GetActiveWeapon()->m_fMaxRange2 );
|
||||
flMinRange = min( GetActiveWeapon()->m_fMinRange1, GetActiveWeapon()->m_fMinRange2 );
|
||||
flMaxRange = MAX( GetActiveWeapon()->m_fMaxRange1, GetActiveWeapon()->m_fMaxRange2 );
|
||||
flMinRange = MIN( GetActiveWeapon()->m_fMinRange1, GetActiveWeapon()->m_fMinRange2 );
|
||||
}
|
||||
|
||||
// Check against NPC's max range
|
||||
@ -2054,8 +2054,8 @@ void CAI_BaseNPC::StartTask( const Task_t *pTask )
|
||||
float flMinRange = 0;
|
||||
if (GetActiveWeapon())
|
||||
{
|
||||
flMaxRange = max(GetActiveWeapon()->m_fMaxRange1,GetActiveWeapon()->m_fMaxRange2);
|
||||
flMinRange = min(GetActiveWeapon()->m_fMinRange1,GetActiveWeapon()->m_fMinRange2);
|
||||
flMaxRange = MAX(GetActiveWeapon()->m_fMaxRange1,GetActiveWeapon()->m_fMaxRange2);
|
||||
flMinRange = MIN(GetActiveWeapon()->m_fMinRange1,GetActiveWeapon()->m_fMinRange2);
|
||||
}
|
||||
|
||||
// Check against NPC's max range
|
||||
@ -3453,7 +3453,7 @@ void CAI_BaseNPC::RunTask( const Task_t *pTask )
|
||||
}
|
||||
|
||||
AngleVectors( ang, &move );
|
||||
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, min(36,pTask->flTaskData), true ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ))
|
||||
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, MIN(36,pTask->flTaskData), true ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ))
|
||||
{
|
||||
TaskComplete();
|
||||
}
|
||||
@ -3462,7 +3462,7 @@ void CAI_BaseNPC::RunTask( const Task_t *pTask )
|
||||
ang.y = GetMotor()->GetIdealYaw() + 91;
|
||||
AngleVectors( ang, &move );
|
||||
|
||||
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, min(24,pTask->flTaskData), true ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ) )
|
||||
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, MIN(24,pTask->flTaskData), true ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ) )
|
||||
{
|
||||
TaskComplete();
|
||||
}
|
||||
@ -3479,7 +3479,7 @@ void CAI_BaseNPC::RunTask( const Task_t *pTask )
|
||||
ang.y = GetMotor()->GetIdealYaw() + 271;
|
||||
AngleVectors( ang, &move );
|
||||
|
||||
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, min(24,pTask->flTaskData), true ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ) )
|
||||
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, MIN(24,pTask->flTaskData), true ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ) )
|
||||
{
|
||||
TaskComplete();
|
||||
}
|
||||
@ -3501,7 +3501,7 @@ void CAI_BaseNPC::RunTask( const Task_t *pTask )
|
||||
|
||||
AngleVectors( ang, &move );
|
||||
|
||||
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, min(6,pTask->flTaskData), false ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ) )
|
||||
if ( GetNavigator()->SetVectorGoal( move, (float)pTask->flTaskData, MIN(6,pTask->flTaskData), false ) && IsValidMoveAwayDest( GetNavigator()->GetGoalPos() ) )
|
||||
{
|
||||
TaskComplete();
|
||||
}
|
||||
|
Reference in New Issue
Block a user