RemotePlayer: make peer ID always reflect the validity of PlayerSAO (#14317)
Upon disconnect, RemotePlayer still had a peer ID assigned even though the PlayerSAO object was maked as gone (for removal). This commit makes that the following always holds true: (!sao || sao->isGone()) === (peer_id == PEER_ID_INEXISTENT)
This commit is contained in:
@@ -69,6 +69,11 @@ RemotePlayer::RemotePlayer(const char *name, IItemDefManager *idef):
|
||||
m_star_params = SkyboxDefaults::getStarDefaults();
|
||||
}
|
||||
|
||||
RemotePlayer::~RemotePlayer()
|
||||
{
|
||||
if (m_sao)
|
||||
m_sao->setPlayer(nullptr);
|
||||
}
|
||||
|
||||
RemotePlayerChatResult RemotePlayer::canSendChatMessage()
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user