pathfinder optimizations

This commit is contained in:
GameHerobrine 2023-01-05 02:31:56 +03:00
parent cba1879947
commit 60c8603c8b
13 changed files with 58 additions and 145 deletions

View file

@ -32,9 +32,9 @@ abstract class Living extends Entity implements Damageable, Pathfindable{
}
if($this->onGround){
/*if($this->path === null && $this->pathFinder instanceof ITileNavigator){ // mt_rand(0, 120) === 0){
$this->path = $this->pathFinder->navigate(new PathTileXYZ($this->x, $this->y, $this->z, $this->level), new PathTileXYZ($this->x + mt_rand(-10, 10), $this->y, $this->z + mt_rand(-10, 10), $this->level), 10);
}*/
//if(!$this->hasPath() && $this->pathFinder instanceof ITileNavigator){ // mt_rand(0, 120) === 0){
// $this->path = $this->pathFinder->navigate(new PathTileXYZ($this->x, $this->y, $this->z, $this->level), new PathTileXYZ($this->x + mt_rand(-10, 10), $this->y, $this->z + mt_rand(-10, 10), $this->level), 10);
//}
$this->pathFollower->followPath();
}