Player::teleport will set motion to 0, fixed possible divby0 when skeletonm shooting the player, fixed entities not untargetting dead players, fixed wrong distance calculations

This commit is contained in:
GameHerobrine 2024-07-12 17:50:06 +03:00
parent 2cd42fb605
commit 81aa575749
7 changed files with 84 additions and 30 deletions

View file

@ -584,7 +584,7 @@ class Level{
$e->handlePrePlayerSearcher();
foreach($this->players as $player){
$dist = ($e->x - $player->entity->x)*($e->x - $player->entity->x) + ($e->y - $player->entity->y) + ($e->z - $player->entity->z);
$dist = ($e->x - $player->entity->x)*($e->x - $player->entity->x) + ($e->y - $player->entity->y)*($e->y - $player->entity->y) + ($e->z - $player->entity->z)*($e->z - $player->entity->z);
$e->handlePlayerSearcher($player, $dist);
}
}