From aa93874a458d89b86ff91259568d379d566dafbc Mon Sep 17 00:00:00 2001 From: Kai Philipp Date: Tue, 10 Sep 2019 04:50:24 +0200 Subject: [PATCH] bugfix --- src/net/common/servergame.cpp | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/net/common/servergame.cpp b/src/net/common/servergame.cpp index dfa3dc73..63028e9d 100644 --- a/src/net/common/servergame.cpp +++ b/src/net/common/servergame.cpp @@ -455,12 +455,17 @@ ServerGame::StoreLastGames() RankingMap::const_iterator i = m_rankingMap.begin(); RankingMap::const_iterator end = m_rankingMap.end(); while (i != end) { - std::vector lastGames = GetSessionManager().GetSessionByUniquePlayerId((*i).second.dbid).GetPlayerLastGames(); - if(lastGames) - //GetLobbyThread().GetDatabase().SetGamePlayerPlace(GetId(), (*i).second.dbid, lastGames); - LOG_VERBOSE("first timeStamp" << lastGames.front().first << "."); - + boost::shared_ptr tmpSession = GetSessionManager().GetSessionByUniquePlayerId((*i).second.dbid); + + + if(tmpSession){ + std::vector lastGames = tmpSession->GetPlayerLastGames(); + + if(lastGames) + //GetLobbyThread().GetDatabase().SetGamePlayerPlace(GetId(), (*i).second.dbid, lastGames); + LOG_VERBOSE("first timeStamp" << lastGames.front().first << "."); + } ++i; } GetDatabase().EndGame(GetId());