mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 15:19:56 +00:00
World: fix bug in getNearestEntity()
fuck you PhpStorm
This commit is contained in:
parent
7e5193355e
commit
aa60aa69ee
@ -1889,7 +1889,7 @@ class World implements ChunkManager{
|
|||||||
if(!($entity instanceof $entityType) or $entity->isFlaggedForDespawn() or (!$includeDead and !$entity->isAlive())){
|
if(!($entity instanceof $entityType) or $entity->isFlaggedForDespawn() or (!$includeDead and !$entity->isAlive())){
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
$distSq = $entity->distanceSquared($pos);
|
$distSq = $entity->getPosition()->distanceSquared($pos);
|
||||||
if($distSq < $currentTargetDistSq){
|
if($distSq < $currentTargetDistSq){
|
||||||
$currentTargetDistSq = $distSq;
|
$currentTargetDistSq = $distSq;
|
||||||
$currentTarget = $entity;
|
$currentTarget = $entity;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user