Prevent allocate memory if player doesn't exists

pull/133/head
Koncord 8 years ago
parent 97dd8704a3
commit 32615d05cf

@ -52,6 +52,8 @@ void Players::newPlayer(RakNet::RakNetGUID guid)
Player *Players::getPlayer(RakNet::RakNetGUID guid)
{
if(players.count(guid) == 0)
return nullptr;
return players[guid];
}

Loading…
Cancel
Save