forked from mirror/openmw-tes3mp
Fix server crash if player is not fully connected
This commit is contained in:
parent
79532cf797
commit
50d989d767
1 changed files with 5 additions and 2 deletions
|
@ -405,8 +405,11 @@ void Networking::NewPlayer(RakNet::RakNetGUID guid)
|
|||
|
||||
void Networking::DisconnectPlayer(RakNet::RakNetGUID guid)
|
||||
{
|
||||
Script::Call<Script::CallbackIdentity("OnPlayerDisconnect")>(Players::GetPlayer(guid)->GetID());
|
||||
controller->GetPacket(ID_USER_DISCONNECTED)->Send(Players::GetPlayer(guid), true);
|
||||
Player *player = Players::GetPlayer(guid);
|
||||
if(!player)
|
||||
return;
|
||||
Script::Call<Script::CallbackIdentity("OnPlayerDisconnect")>(player->GetID());
|
||||
controller->GetPacket(ID_USER_DISCONNECTED)->Send(player, true);
|
||||
Players::DeletePlayer(guid);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue