From 93c26a0b0c925ca8922931aad5e4d89abe1917b0 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Thu, 29 Nov 2018 18:45:46 +0000 Subject: [PATCH] Living: Suspend effects ticking on death This was the cause of a bug with regeneration which caused players taking fatal damage under regeneration not to die correctly. On the server side they would die and immediately regenerate some health, which would cause the next attribute sync to not report the health drop to zero, which made the client unaware that it was dead. Perhaps attributes should be forcibly synced in some circumstances, but nonetheless regeneration shouldn't apply post-death. --- src/pocketmine/entity/Living.php | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/pocketmine/entity/Living.php b/src/pocketmine/entity/Living.php index 783b3f3f7..18f363363 100644 --- a/src/pocketmine/entity/Living.php +++ b/src/pocketmine/entity/Living.php @@ -655,11 +655,11 @@ abstract class Living extends Entity implements Damageable{ $hasUpdate = parent::entityBaseTick($tickDiff); - if($this->doEffectsTick($tickDiff)){ - $hasUpdate = true; - } - if($this->isAlive()){ + if($this->doEffectsTick($tickDiff)){ + $hasUpdate = true; + } + if($this->isInsideOfSolid()){ $hasUpdate = true; $ev = new EntityDamageEvent($this, EntityDamageEvent::CAUSE_SUFFOCATION, 1);