mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-10-18 12:04:46 +00:00
Fixed #1591, handle player disconnect and level change killing
This commit is contained in:
@@ -425,7 +425,10 @@ abstract class Entity extends Position implements Metadatable{
|
||||
}
|
||||
|
||||
if($this->y < -64){
|
||||
$this->kill();
|
||||
$this->server->getPluginManager()->callEvent($ev = new EntityDamageEvent($this, EntityDamageEvent::CAUSE_VOID, 10));
|
||||
if(!$ev->isCancelled()){
|
||||
$this->attack($ev->getFinalDamage(), $ev);
|
||||
}
|
||||
}
|
||||
|
||||
if($this->fireTicks > 0){
|
||||
@@ -960,8 +963,8 @@ abstract class Entity extends Position implements Metadatable{
|
||||
if($this->dead){
|
||||
return;
|
||||
}
|
||||
$this->setHealth(0);
|
||||
$this->dead = true;
|
||||
$this->setHealth(0);
|
||||
$this->scheduleUpdate();
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user