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:
parent
a36308b0bf
commit
8150a7d9bc
@ -828,7 +828,7 @@ static unsigned char ComputeDistanceFade( C_BaseEntity *pEntity, float flMinDist
|
||||
|
||||
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.
|
||||
|
@ -3459,7 +3459,7 @@ void CVisibleShadowList::PrioritySort()
|
||||
flLargestArea = m_ShadowsInView[nIndex].m_flArea;
|
||||
}
|
||||
}
|
||||
swap( m_PriorityIndex[i], m_PriorityIndex[nLargestInd] );
|
||||
V_swap( m_PriorityIndex[i], m_PriorityIndex[nLargestInd] );
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -507,8 +507,8 @@ void SortEntities( CRenderList::CEntry *pEntities, int nEntities )
|
||||
{
|
||||
if( dists[i] > dists[i+stepSize] )
|
||||
{
|
||||
swap( pEntities[i], pEntities[i+stepSize] );
|
||||
swap( dists[i], dists[i+stepSize] );
|
||||
V_swap( pEntities[i], pEntities[i+stepSize] );
|
||||
V_swap( dists[i], dists[i+stepSize] );
|
||||
|
||||
if( i == 0 )
|
||||
{
|
||||
|
@ -503,7 +503,7 @@ bool CFilterEnemy::PassesProximityFilter( CBaseEntity *pCaller, CBaseEntity *pEn
|
||||
float flSmallerRadius = m_flRadius;
|
||||
if ( flSmallerRadius > flLargerRadius )
|
||||
{
|
||||
swap( flLargerRadius, flSmallerRadius );
|
||||
V_swap( flLargerRadius, flSmallerRadius );
|
||||
}
|
||||
|
||||
float flDist;
|
||||
|
@ -1669,7 +1669,7 @@ void CNPC_AttackHelicopter::ShootAtPlayer( const Vector &vBasePos, const Vector
|
||||
for ( i = 0; i < nActualTargets; ++i )
|
||||
{
|
||||
int nSwap = random->RandomInt( 0, nActualTargets - 1 );
|
||||
swap( ppNearbyTargets[i], ppNearbyTargets[nSwap] );
|
||||
V_swap( ppNearbyTargets[i], ppNearbyTargets[nSwap] );
|
||||
}
|
||||
|
||||
// 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 )
|
||||
{
|
||||
int nSwap = random->RandomInt( 0, nActualTargets - 1 );
|
||||
swap( ppNearbyTargets[i], ppNearbyTargets[nSwap] );
|
||||
V_swap( ppNearbyTargets[i], ppNearbyTargets[nSwap] );
|
||||
}
|
||||
|
||||
// Just shoot where we're facing
|
||||
|
@ -355,7 +355,7 @@ void CNPC_CombineCamera::Spawn()
|
||||
|
||||
if (m_nOuterRadius < m_nInnerRadius)
|
||||
{
|
||||
swap(m_nOuterRadius, m_nInnerRadius);
|
||||
V_swap(m_nOuterRadius, m_nInnerRadius);
|
||||
}
|
||||
|
||||
// Do we start active?
|
||||
@ -1117,17 +1117,17 @@ void CNPC_CombineCamera::SetHeight(float height)
|
||||
|
||||
if (mins.x > maxs.x)
|
||||
{
|
||||
swap(mins.x, maxs.x);
|
||||
V_swap(mins.x, maxs.x);
|
||||
}
|
||||
|
||||
if (mins.y > maxs.y)
|
||||
{
|
||||
swap(mins.y, maxs.y);
|
||||
V_swap(mins.y, maxs.y);
|
||||
}
|
||||
|
||||
if (mins.z > maxs.z)
|
||||
{
|
||||
swap(mins.z, maxs.z);
|
||||
V_swap(mins.z, maxs.z);
|
||||
}
|
||||
|
||||
SetCollisionBounds(mins, maxs);
|
||||
|
@ -1093,17 +1093,17 @@ void CNPC_CeilingTurret::SetHeight( float height )
|
||||
|
||||
if ( mins.x > maxs.x )
|
||||
{
|
||||
swap( mins.x, maxs.x );
|
||||
V_swap( mins.x, maxs.x );
|
||||
}
|
||||
|
||||
if ( mins.y > maxs.y )
|
||||
{
|
||||
swap( mins.y, maxs.y );
|
||||
V_swap( mins.y, maxs.y );
|
||||
}
|
||||
|
||||
if ( mins.z > maxs.z )
|
||||
{
|
||||
swap( mins.z, maxs.z );
|
||||
V_swap( mins.z, maxs.z );
|
||||
}
|
||||
|
||||
SetCollisionBounds( mins, maxs );
|
||||
|
@ -555,7 +555,7 @@ void CHLTVDirector::CreateShotFromEvent( CGameEvent *event )
|
||||
// if we show ineye view, show it more likely from killer
|
||||
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
|
||||
|
@ -830,7 +830,7 @@ IPhysicsConstraint *CPhysSlideConstraint::CreateConstraint( IPhysicsConstraintGr
|
||||
sliding.limitMax = DotProduct( axisDirection, m_axisEnd );
|
||||
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
|
||||
|
@ -4571,7 +4571,7 @@ void CPropDoorRotating::Spawn()
|
||||
// that the model already be set.
|
||||
if ( IsHingeOnLeft() )
|
||||
{
|
||||
swap( m_angRotationOpenForward, m_angRotationOpenBack );
|
||||
V_swap( m_angRotationOpenForward, m_angRotationOpenBack );
|
||||
}
|
||||
|
||||
// Figure out our volumes of movement as this door opens
|
||||
|
@ -580,7 +580,7 @@ bool CGameRules::ShouldCollide( int collisionGroup0, int collisionGroup1 )
|
||||
if ( collisionGroup0 > collisionGroup1 )
|
||||
{
|
||||
// swap so that lowest is always first
|
||||
swap(collisionGroup0,collisionGroup1);
|
||||
V_swap(collisionGroup0,collisionGroup1);
|
||||
}
|
||||
|
||||
#ifndef HL2MP
|
||||
|
@ -866,7 +866,7 @@ bool CHL2MPRules::ShouldCollide( int collisionGroup0, int collisionGroup1 )
|
||||
if ( collisionGroup0 > collisionGroup1 )
|
||||
{
|
||||
// swap so that lowest is always first
|
||||
swap(collisionGroup0,collisionGroup1);
|
||||
V_swap(collisionGroup0,collisionGroup1);
|
||||
}
|
||||
|
||||
if ( (collisionGroup0 == COLLISION_GROUP_PLAYER || collisionGroup0 == COLLISION_GROUP_PLAYER_MOVEMENT) &&
|
||||
|
@ -315,7 +315,7 @@ bool CSDKGameRules::ShouldCollide( int collisionGroup0, int collisionGroup1 )
|
||||
if ( collisionGroup0 > collisionGroup1 )
|
||||
{
|
||||
// swap so that lowest is always first
|
||||
swap(collisionGroup0,collisionGroup1);
|
||||
V_swap(collisionGroup0,collisionGroup1);
|
||||
}
|
||||
|
||||
//Don't stand on COLLISION_GROUP_WEAPON
|
||||
|
@ -362,7 +362,7 @@ STRIPLIST::iterator FindBestCachedStrip(STRIPLIST *pstriplist,
|
||||
// make sure we keep the list in order and always pull off
|
||||
// the first dude.
|
||||
if(istriplistbest != pstriplist->begin())
|
||||
swap(*istriplistbest, *pstriplist->begin());
|
||||
V_swap(*istriplistbest, *pstriplist->begin());
|
||||
|
||||
return pstriplist->begin();
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user