bugfix vector erase
This commit is contained in:
+3
-2
@@ -285,12 +285,13 @@ LOG_ERROR("checking IsPlayerAllowedToJoinCreateLimitRank() ");
|
|||||||
int count = 0;
|
int count = 0;
|
||||||
int i=0;
|
int i=0;
|
||||||
for(std::vector<long>::iterator timeStamp = m_last_games.begin(); timeStamp != m_last_games.end(); ++timeStamp) {
|
for(std::vector<long>::iterator timeStamp = m_last_games.begin(); timeStamp != m_last_games.end(); ++timeStamp) {
|
||||||
|
LOG_ERROR("timeStamp " << *timeStamp);
|
||||||
if(*timeStamp > then){
|
if(*timeStamp > then){
|
||||||
LOG_ERROR("counting timeStamp in time " << *timeStamp);
|
LOG_ERROR("counting timeStamp in time " << *timeStamp);
|
||||||
count++;
|
count++;
|
||||||
}else{
|
}else{
|
||||||
LOG_ERROR("erasing overdued timestamp " << *timeStamp);
|
//LOG_ERROR("erasing overdued timestamp " << *timeStamp);
|
||||||
m_last_games.erase(m_last_games.begin() + i); // erase overdued entries
|
//m_last_games.erase(m_last_games.begin() + i); // erase overdued entries
|
||||||
}
|
}
|
||||||
i++;
|
i++;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user