mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-21 03:59:43 +00:00
mobs will attack now, fixed division by 0(i hate php)
This commit is contained in:
parent
616c933d3d
commit
b8589c9dd4
13 changed files with 71 additions and 5 deletions
|
|
@ -64,7 +64,7 @@ class MobController
|
|||
|
||||
if($pitch){
|
||||
$diff = sqrt($x * $x + $z * $z);
|
||||
$calcPitch = rad2deg(atan($y / $diff));
|
||||
$calcPitch = $diff == 0 ? ($y < 0 ? -90 : 90) : rad2deg(atan($y / $diff));
|
||||
$this->entity->pitch = $this->entity->type === MOB_CHICKEN ? -$calcPitch : $calcPitch;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue