mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-05-14 17:59:41 +00:00
NetworkSession: do not respond to death before player spawn, fixes #3513
there's a few changes that can be made to avoid this problem, the primary one being to separate this API from NetworkSession and abstract it away... but this is a reasonable, although not great, solution.
This commit is contained in:
parent
2104b2d32b
commit
0d13a3fbdb
@ -645,7 +645,9 @@ class NetworkSession{
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function onDeath() : void{
|
public function onDeath() : void{
|
||||||
$this->setHandler(new DeathPacketHandler($this->player, $this));
|
if($this->handler instanceof InGamePacketHandler){ //TODO: this is a bad fix for pre-spawn death, this shouldn't be reachable at all at this stage :(
|
||||||
|
$this->setHandler(new DeathPacketHandler($this->player, $this));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public function onRespawn() : void{
|
public function onRespawn() : void{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user