Use qualified std::swap only

This commit is contained in:
Robert Müller 2022-05-15 19:25:36 +02:00
parent 535fbd28fa
commit 52100dbbe7
4 changed files with 9 additions and 9 deletions

View file

@ -27,7 +27,7 @@ void CLineInput::Set(const char *pString)
void CLineInput::SetRange(const char *pString, int Begin, int End)
{
if(Begin > End)
swap(Begin, End);
std::swap(Begin, End);
Begin = clamp(Begin, 0, m_Len);
End = clamp(End, 0, m_Len);

View file

@ -231,7 +231,7 @@ int CLayerGroup::SwapLayers(int Index0, int Index1)
if(Index0 == Index1)
return Index0;
m_pMap->m_Modified = true;
swap(m_lLayers[Index0], m_lLayers[Index1]);
std::swap(m_lLayers[Index0], m_lLayers[Index1]);
return Index1;
}
@ -1946,11 +1946,11 @@ void CEditor::DoQuadKnife(int QuadIndex)
IsInTriangle(m_aQuadKnifePoints[1], m_aQuadKnifePoints[0], m_aQuadKnifePoints[2], m_aQuadKnifePoints[3]))
{
// Fix concave order
swap(m_aQuadKnifePoints[0], m_aQuadKnifePoints[3]);
swap(m_aQuadKnifePoints[1], m_aQuadKnifePoints[2]);
std::swap(m_aQuadKnifePoints[0], m_aQuadKnifePoints[3]);
std::swap(m_aQuadKnifePoints[1], m_aQuadKnifePoints[2]);
}
swap(m_aQuadKnifePoints[2], m_aQuadKnifePoints[3]);
std::swap(m_aQuadKnifePoints[2], m_aQuadKnifePoints[3]);
CQuad *pResult = pLayer->NewQuad(64, 64, 64, 64);
pQuad = &pLayer->m_lQuads[QuadIndex];

View file

@ -416,7 +416,7 @@ public:
if(Index0 == Index1)
return Index0;
m_Modified = true;
swap(m_lGroups[Index0], m_lGroups[Index1]);
std::swap(m_lGroups[Index0], m_lGroups[Index1]);
return Index1;
}

View file

@ -902,9 +902,9 @@ void CGameTeams::SwapTeamCharacters(CPlayer *pPlayer, CPlayer *pTargetPlayer, in
PrimarySavedTee.Load(pTargetPlayer->GetCharacter(), Team, true);
SecondarySavedTee.Load(pPlayer->GetCharacter(), Team, true);
swap(m_TeeStarted[pPlayer->GetCID()], m_TeeStarted[pTargetPlayer->GetCID()]);
swap(m_TeeFinished[pPlayer->GetCID()], m_TeeFinished[pTargetPlayer->GetCID()]);
swap(pPlayer->GetCharacter()->GetRescueTeeRef(), pTargetPlayer->GetCharacter()->GetRescueTeeRef());
std::swap(m_TeeStarted[pPlayer->GetCID()], m_TeeStarted[pTargetPlayer->GetCID()]);
std::swap(m_TeeFinished[pPlayer->GetCID()], m_TeeFinished[pTargetPlayer->GetCID()]);
std::swap(pPlayer->GetCharacter()->GetRescueTeeRef(), pTargetPlayer->GetCharacter()->GetRescueTeeRef());
GameServer()->m_World.SwapClients(pPlayer->GetCID(), pTargetPlayer->GetCID());