ai tweaks, pitch and yaw should be always updated(not only when pos changed)

This commit is contained in:
GameHerobrine 2022-12-23 07:38:42 +03:00
parent 8b036abf8e
commit be9a9c0c0d
8 changed files with 17 additions and 34 deletions

View file

@ -54,9 +54,9 @@ class MobController
public function lookOn($x, $y = 0, $z = 0, $pitch = true){
if($x instanceof Vector3){
return $this->lookOn($x->x, $x->y + ($x->getEyeHeight() ?: 0), $x->z);
return $this->lookOn($x->x, $x->y + $x->getEyeHeight(), $x->z, $pitch);
}
return $this->lookOffset($x - $this->entity->x, $this->entity->y + $this->entity->height - $y, $z - $this->entity->z, $pitch);
return $this->lookOffset($x - $this->entity->x, ($this->entity->y + $this->entity->height) - $y, $z - $this->entity->z, $pitch);
}
public function __destruct(){