mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Use qualified std::swap only
This commit is contained in:
parent
535fbd28fa
commit
52100dbbe7
|
@ -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);
|
||||
|
||||
|
|
|
@ -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];
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
|
@ -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());
|
||||
|
||||
|
|
Loading…
Reference in a new issue