ExperienceOrb: stop tracking targets if they die while being tracked

This commit is contained in:
Dylan K. Taylor 2018-06-23 16:41:21 +01:00
parent 0081e30a89
commit d3e54db146

View File

@ -165,7 +165,7 @@ class ExperienceOrb extends Entity{
}
$currentTarget = $this->getTargetPlayer();
if($currentTarget !== null and $currentTarget->distanceSquared($this) > self::MAX_TARGET_DISTANCE ** 2){
if($currentTarget !== null and (!$currentTarget->isAlive() or $currentTarget->distanceSquared($this) > self::MAX_TARGET_DISTANCE ** 2)){
$currentTarget = null;
}