@@ -1531,7 +1531,7 @@ void CAdminSystem::AddOrUpdateAdmin(uint64 iSteamID, uint64 iFlags, int iAdminIm
15311531
15321532bool CAdminSystem::LoadInfractions ()
15331533{
1534- m_vecInfractions.PurgeAndDeleteElements ();
1534+ m_vecInfractions.clear ();
15351535 KeyValues* pKV = new KeyValues (" infractions" );
15361536 KeyValues::AutoDelete autoDelete (pKV);
15371537
@@ -1592,7 +1592,7 @@ void CAdminSystem::SaveInfractions()
15921592 KeyValues* pSubKey;
15931593 KeyValues::AutoDelete autoDelete (pKV);
15941594
1595- FOR_EACH_VEC ( m_vecInfractions, i )
1595+ for ( int i = 0 ; i < m_vecInfractions. size (); i++ )
15961596 {
15971597 time_t timestamp = m_vecInfractions[i]->GetTimestamp ();
15981598 if (timestamp != 0 && timestamp < std::time (0 ))
@@ -1620,15 +1620,15 @@ void CAdminSystem::SaveInfractions()
16201620
16211621void CAdminSystem::AddInfraction (CInfractionBase* infraction)
16221622{
1623- m_vecInfractions.AddToTail (infraction);
1623+ m_vecInfractions.push_back (infraction);
16241624}
16251625
16261626// This function can run at least twice when a player connects: Immediately upon client connection, and also upon getting authenticated by steam.
16271627// It's also run when we're periodically checking for infraction expiry in the case of mutes/gags.
16281628// This returns false only when called from ClientConnect and the player is banned in order to reject them.
16291629bool CAdminSystem::ApplyInfractions (ZEPlayer* player)
16301630{
1631- FOR_EACH_VEC ( m_vecInfractions, i )
1631+ for ( int i = m_vecInfractions. size () - 1 ; i >= 0 ; i-- )
16321632 {
16331633 // Because this can run without the player being authenticated, and the fact that we're applying a ban/mute here,
16341634 // we can immediately just use the steamid we got from the connecting player.
@@ -1644,7 +1644,7 @@ bool CAdminSystem::ApplyInfractions(ZEPlayer* player)
16441644 time_t timestamp = m_vecInfractions[i]->GetTimestamp ();
16451645 if (timestamp != 0 && timestamp <= std::time (0 ))
16461646 {
1647- m_vecInfractions.Remove ( i);
1647+ m_vecInfractions.erase (m_vecInfractions. begin () + i);
16481648 continue ;
16491649 }
16501650
@@ -1660,12 +1660,12 @@ bool CAdminSystem::ApplyInfractions(ZEPlayer* player)
16601660
16611661bool CAdminSystem::FindAndRemoveInfraction (ZEPlayer* player, CInfractionBase::EInfractionType type)
16621662{
1663- FOR_EACH_VEC_BACK ( m_vecInfractions, i )
1663+ for ( int i = m_vecInfractions. size () - 1 ; i >= 0 ; i-- )
16641664 {
16651665 if (m_vecInfractions[i]->GetSteamId64 () == player->GetSteamId64 () && m_vecInfractions[i]->GetType () == type)
16661666 {
16671667 m_vecInfractions[i]->UndoInfraction (player);
1668- m_vecInfractions.Remove ( i);
1668+ m_vecInfractions.erase (m_vecInfractions. begin () + i);
16691669
16701670 return true ;
16711671 }
@@ -1676,11 +1676,11 @@ bool CAdminSystem::FindAndRemoveInfraction(ZEPlayer* player, CInfractionBase::EI
16761676
16771677bool CAdminSystem::FindAndRemoveInfractionSteamId64 (uint64 steamid64, CInfractionBase::EInfractionType type)
16781678{
1679- FOR_EACH_VEC_BACK ( m_vecInfractions, i )
1679+ for ( int i = m_vecInfractions. size () - 1 ; i >= 0 ; i-- )
16801680 {
16811681 if (m_vecInfractions[i]->GetSteamId64 () == steamid64 && m_vecInfractions[i]->GetType () == type)
16821682 {
1683- m_vecInfractions.Remove ( i);
1683+ m_vecInfractions.erase (m_vecInfractions. begin () + i);
16841684
16851685 return true ;
16861686 }
0 commit comments