diff --git a/src/net/common/servergame.cpp b/src/net/common/servergame.cpp index 4ca1aaa5..16137cc2 100644 --- a/src/net/common/servergame.cpp +++ b/src/net/common/servergame.cpp @@ -270,7 +270,8 @@ ServerGame::InternalStartGame() m_game.reset(new Game(&gui, factory, playerData, GetGameData(), GetStartData(), GetNextGameNum())); GetLobbyThread().NotifyStartingGame(GetId()); - GetLobbyThread().GetDatabase().AsyncCreateGame(GetId(), GetName()); + if (GetGameData().gameType == GAME_TYPE_RANKING) + GetLobbyThread().GetDatabase().AsyncCreateGame(GetId(), GetName()); } void diff --git a/src/net/common/servergamestate.cpp b/src/net/common/servergamestate.cpp index f90eae4d..5e616b09 100644 --- a/src/net/common/servergamestate.cpp +++ b/src/net/common/servergamestate.cpp @@ -928,7 +928,7 @@ ServerGameStateHand::EngineLoop(boost::shared_ptr server) // Store winner in database. boost::shared_ptr winnerPlayer = *(playersWithCash.begin()); boost::shared_ptr tmpPlayer = server->GetPlayerDataByUniqueId(winnerPlayer->getMyUniqueID()); - if (tmpPlayer) + if (tmpPlayer && server->GetDBId()) { cerr << "Setting winner for game " << server->GetDBId() << " player id " << tmpPlayer->GetDBId() << endl; server->GetLobbyThread().GetDatabase().SetGamePlayerPlace(server->GetDBId(), tmpPlayer->GetDBId(), 1);