De-spaghettify spawn notification handling

This commit is contained in:
Dylan K. Taylor
2019-06-10 19:31:54 +01:00
parent 714393820f
commit 3ac0c98199
3 changed files with 2 additions and 3 deletions

View File

@ -567,6 +567,7 @@ class NetworkSession{
}
public function onSpawn() : void{
$this->player->doFirstSpawn();
$this->setHandler(new InGameSessionHandler($this->player, $this));
}

View File

@ -108,7 +108,7 @@ class PreSpawnSessionHandler extends SessionHandler{
public function handleSetLocalPlayerAsInitialized(SetLocalPlayerAsInitializedPacket $packet) : bool{
$this->player->setImmobile(false); //HACK: this is set to prevent client-side falling before spawn
$this->player->doFirstSpawn();
$this->session->onSpawn();
return true;
}