1
0
mirror of https://github.com/alliedmodders/hl2sdk.git synced 2024-12-23 01:59:43 +08:00

Resolve conflicts with std::swap.

This commit is contained in:
David Anderson 2020-06-01 22:17:46 -07:00
parent a36308b0bf
commit 8150a7d9bc
14 changed files with 21 additions and 21 deletions

View File

@ -828,7 +828,7 @@ static unsigned char ComputeDistanceFade( C_BaseEntity *pEntity, float flMinDist
if( flMinDist > flMaxDist ) if( flMinDist > flMaxDist )
{ {
swap( flMinDist, flMaxDist ); V_swap( flMinDist, flMaxDist );
} }
// If a negative value is provided for the min fade distance, then base it off the max. // If a negative value is provided for the min fade distance, then base it off the max.

View File

@ -3459,7 +3459,7 @@ void CVisibleShadowList::PrioritySort()
flLargestArea = m_ShadowsInView[nIndex].m_flArea; flLargestArea = m_ShadowsInView[nIndex].m_flArea;
} }
} }
swap( m_PriorityIndex[i], m_PriorityIndex[nLargestInd] ); V_swap( m_PriorityIndex[i], m_PriorityIndex[nLargestInd] );
} }
} }

View File

@ -507,8 +507,8 @@ void SortEntities( CRenderList::CEntry *pEntities, int nEntities )
{ {
if( dists[i] > dists[i+stepSize] ) if( dists[i] > dists[i+stepSize] )
{ {
swap( pEntities[i], pEntities[i+stepSize] ); V_swap( pEntities[i], pEntities[i+stepSize] );
swap( dists[i], dists[i+stepSize] ); V_swap( dists[i], dists[i+stepSize] );
if( i == 0 ) if( i == 0 )
{ {

View File

@ -503,7 +503,7 @@ bool CFilterEnemy::PassesProximityFilter( CBaseEntity *pCaller, CBaseEntity *pEn
float flSmallerRadius = m_flRadius; float flSmallerRadius = m_flRadius;
if ( flSmallerRadius > flLargerRadius ) if ( flSmallerRadius > flLargerRadius )
{ {
swap( flLargerRadius, flSmallerRadius ); V_swap( flLargerRadius, flSmallerRadius );
} }
float flDist; float flDist;

View File

@ -1669,7 +1669,7 @@ void CNPC_AttackHelicopter::ShootAtPlayer( const Vector &vBasePos, const Vector
for ( i = 0; i < nActualTargets; ++i ) for ( i = 0; i < nActualTargets; ++i )
{ {
int nSwap = random->RandomInt( 0, nActualTargets - 1 ); int nSwap = random->RandomInt( 0, nActualTargets - 1 );
swap( ppNearbyTargets[i], ppNearbyTargets[nSwap] ); V_swap( ppNearbyTargets[i], ppNearbyTargets[nSwap] );
} }
// Just shoot where we're facing // Just shoot where we're facing
@ -1906,7 +1906,7 @@ void CNPC_AttackHelicopter::ShootAtVehicle( const Vector &vBasePos, const Vector
for ( i = 0; i < nActualTargets; ++i ) for ( i = 0; i < nActualTargets; ++i )
{ {
int nSwap = random->RandomInt( 0, nActualTargets - 1 ); int nSwap = random->RandomInt( 0, nActualTargets - 1 );
swap( ppNearbyTargets[i], ppNearbyTargets[nSwap] ); V_swap( ppNearbyTargets[i], ppNearbyTargets[nSwap] );
} }
// Just shoot where we're facing // Just shoot where we're facing

View File

@ -355,7 +355,7 @@ void CNPC_CombineCamera::Spawn()
if (m_nOuterRadius < m_nInnerRadius) if (m_nOuterRadius < m_nInnerRadius)
{ {
swap(m_nOuterRadius, m_nInnerRadius); V_swap(m_nOuterRadius, m_nInnerRadius);
} }
// Do we start active? // Do we start active?
@ -1117,17 +1117,17 @@ void CNPC_CombineCamera::SetHeight(float height)
if (mins.x > maxs.x) if (mins.x > maxs.x)
{ {
swap(mins.x, maxs.x); V_swap(mins.x, maxs.x);
} }
if (mins.y > maxs.y) if (mins.y > maxs.y)
{ {
swap(mins.y, maxs.y); V_swap(mins.y, maxs.y);
} }
if (mins.z > maxs.z) if (mins.z > maxs.z)
{ {
swap(mins.z, maxs.z); V_swap(mins.z, maxs.z);
} }
SetCollisionBounds(mins, maxs); SetCollisionBounds(mins, maxs);

View File

@ -1093,17 +1093,17 @@ void CNPC_CeilingTurret::SetHeight( float height )
if ( mins.x > maxs.x ) if ( mins.x > maxs.x )
{ {
swap( mins.x, maxs.x ); V_swap( mins.x, maxs.x );
} }
if ( mins.y > maxs.y ) if ( mins.y > maxs.y )
{ {
swap( mins.y, maxs.y ); V_swap( mins.y, maxs.y );
} }
if ( mins.z > maxs.z ) if ( mins.z > maxs.z )
{ {
swap( mins.z, maxs.z ); V_swap( mins.z, maxs.z );
} }
SetCollisionBounds( mins, maxs ); SetCollisionBounds( mins, maxs );

View File

@ -555,7 +555,7 @@ void CHLTVDirector::CreateShotFromEvent( CGameEvent *event )
// if we show ineye view, show it more likely from killer // if we show ineye view, show it more likely from killer
if ( RandomFloat(0,1) > (bInEye?0.3f:0.7f) ) if ( RandomFloat(0,1) > (bInEye?0.3f:0.7f) )
{ {
swap( attacker, victim ); V_swap( attacker, victim );
} }
// hurting a victim is shown as chase more often // hurting a victim is shown as chase more often

View File

@ -830,7 +830,7 @@ IPhysicsConstraint *CPhysSlideConstraint::CreateConstraint( IPhysicsConstraintGr
sliding.limitMax = DotProduct( axisDirection, m_axisEnd ); sliding.limitMax = DotProduct( axisDirection, m_axisEnd );
if ( sliding.limitMax < sliding.limitMin ) if ( sliding.limitMax < sliding.limitMin )
{ {
swap( sliding.limitMin, sliding.limitMax ); V_swap( sliding.limitMin, sliding.limitMax );
} }
// expand limits to make initial position of the attached object valid // expand limits to make initial position of the attached object valid

View File

@ -4571,7 +4571,7 @@ void CPropDoorRotating::Spawn()
// that the model already be set. // that the model already be set.
if ( IsHingeOnLeft() ) if ( IsHingeOnLeft() )
{ {
swap( m_angRotationOpenForward, m_angRotationOpenBack ); V_swap( m_angRotationOpenForward, m_angRotationOpenBack );
} }
// Figure out our volumes of movement as this door opens // Figure out our volumes of movement as this door opens

View File

@ -580,7 +580,7 @@ bool CGameRules::ShouldCollide( int collisionGroup0, int collisionGroup1 )
if ( collisionGroup0 > collisionGroup1 ) if ( collisionGroup0 > collisionGroup1 )
{ {
// swap so that lowest is always first // swap so that lowest is always first
swap(collisionGroup0,collisionGroup1); V_swap(collisionGroup0,collisionGroup1);
} }
#ifndef HL2MP #ifndef HL2MP

View File

@ -866,7 +866,7 @@ bool CHL2MPRules::ShouldCollide( int collisionGroup0, int collisionGroup1 )
if ( collisionGroup0 > collisionGroup1 ) if ( collisionGroup0 > collisionGroup1 )
{ {
// swap so that lowest is always first // swap so that lowest is always first
swap(collisionGroup0,collisionGroup1); V_swap(collisionGroup0,collisionGroup1);
} }
if ( (collisionGroup0 == COLLISION_GROUP_PLAYER || collisionGroup0 == COLLISION_GROUP_PLAYER_MOVEMENT) && if ( (collisionGroup0 == COLLISION_GROUP_PLAYER || collisionGroup0 == COLLISION_GROUP_PLAYER_MOVEMENT) &&

View File

@ -315,7 +315,7 @@ bool CSDKGameRules::ShouldCollide( int collisionGroup0, int collisionGroup1 )
if ( collisionGroup0 > collisionGroup1 ) if ( collisionGroup0 > collisionGroup1 )
{ {
// swap so that lowest is always first // swap so that lowest is always first
swap(collisionGroup0,collisionGroup1); V_swap(collisionGroup0,collisionGroup1);
} }
//Don't stand on COLLISION_GROUP_WEAPON //Don't stand on COLLISION_GROUP_WEAPON

View File

@ -362,7 +362,7 @@ STRIPLIST::iterator FindBestCachedStrip(STRIPLIST *pstriplist,
// make sure we keep the list in order and always pull off // make sure we keep the list in order and always pull off
// the first dude. // the first dude.
if(istriplistbest != pstriplist->begin()) if(istriplistbest != pstriplist->begin())
swap(*istriplistbest, *pstriplist->begin()); V_swap(*istriplistbest, *pstriplist->begin());
return pstriplist->begin(); return pstriplist->begin();
} }