Skip to content

Commit

Permalink
Update CGame.cpp
Browse files Browse the repository at this point in the history
  • Loading branch information
Lpsd committed Nov 27, 2023
1 parent 486f2e7 commit 72aeb95
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Server/mods/deathmatch/logic/CGame.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4711,11 +4711,15 @@ void CGame::RegisterClientTriggeredEventUsage(CPlayer* pPlayer)
if (!pPlayer || !pPlayer->IsPlayer() || pPlayer->IsBeingDeleted())
return;

int now = GetTickCount64_();

// If key/player doesn't exist in map, store time of entry
if (m_mapClientTriggeredEvents.find(pPlayer) == m_mapClientTriggeredEvents.end())
m_mapClientTriggeredEvents[pPlayer].second = GetTickCount64_();
m_mapClientTriggeredEvents[pPlayer].second = now;

m_mapClientTriggeredEvents[pPlayer].first++;
// Only increment if we haven't reached the interval time already
if (now - m_mapClientTriggeredEvents[pPlayer].second < m_iClientTriggeredEventsIntervalMs)
m_mapClientTriggeredEvents[pPlayer].first++;
}

void CGame::ProcessClientTriggeredEventSpam()
Expand Down

0 comments on commit 72aeb95

Please sign in to comment.