mirror of
https://github.com/luanti-org/luanti.git
synced 2025-07-02 16:38:41 +00:00
Fix continuing to process TOSERVER_INIT2 even if player doesn't exist
This commit is contained in:
parent
9c5cc217bf
commit
0aeb5adb8f
1 changed files with 6 additions and 2 deletions
|
@ -2176,6 +2176,12 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
||||||
verbosestream<<"Server: Got TOSERVER_INIT2 from "
|
verbosestream<<"Server: Got TOSERVER_INIT2 from "
|
||||||
<<peer_id<<std::endl;
|
<<peer_id<<std::endl;
|
||||||
|
|
||||||
|
Player *player = m_env->getPlayer(peer_id);
|
||||||
|
if(!player){
|
||||||
|
verbosestream<<"Server: TOSERVER_INIT2: "
|
||||||
|
<<"Player not found; ignoring."<<std::endl;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
getClient(peer_id)->serialization_version
|
getClient(peer_id)->serialization_version
|
||||||
= getClient(peer_id)->pending_serialization_version;
|
= getClient(peer_id)->pending_serialization_version;
|
||||||
|
@ -2203,8 +2209,6 @@ void Server::ProcessData(u8 *data, u32 datasize, u16 peer_id)
|
||||||
UpdateCrafting(peer_id);
|
UpdateCrafting(peer_id);
|
||||||
SendInventory(peer_id);
|
SendInventory(peer_id);
|
||||||
|
|
||||||
Player *player = m_env->getPlayer(peer_id);
|
|
||||||
|
|
||||||
// Send HP
|
// Send HP
|
||||||
SendPlayerHP(peer_id);
|
SendPlayerHP(peer_id);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue