vector handling bugfix

This commit is contained in:
Kai Philipp
2019-09-09 22:52:35 +02:00
parent 5fe59ac751
commit 289282dc7a
+4 -4
View File
@@ -438,15 +438,15 @@ SessionData::IsPlayerAllowedToJoinLimitRank()
boost::mutex::scoped_lock lock(m_dataMutex); boost::mutex::scoped_lock lock(m_dataMutex);
// @TODO: iterate m_lastGames // @TODO: iterate m_lastGames
unsigned long then = (unsigned long)time(NULL) - (unsigned long)(SERVER_ALLOWED_RANKING_GAMES_MINUTES * 10); long then = (long)time(NULL) - (long)(SERVER_ALLOWED_RANKING_GAMES_MINUTES * 10);
unsigned long num = (unsigned long)SERVER_ALLOWED_RANKING_GAMES_PER_MINUTES; long num = (long)SERVER_ALLOWED_RANKING_GAMES_PER_MINUTES;
unsigned long count = 0; long count = 0;
auto timeStamp = m_lastGames.begin(); auto timeStamp = m_lastGames.begin();
while (timeStamp != m_lastGames.end()) while (timeStamp != m_lastGames.end())
{ {
if(timeStamp > then) if((long)timeStamp > then)
count++; count++;
else else
m_lastGames.erase(timeStamp); m_lastGames.erase(timeStamp);