mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-06-30 23:29:54 +00:00
Normalized Player pitch/yaw
This commit is contained in:
parent
1174b0c45c
commit
02ca227085
@ -1355,7 +1355,18 @@ class Player extends Human implements CommandSender, InventoryHolder, IPlayer{
|
|||||||
$dy = $newPos->y - $this->y;
|
$dy = $newPos->y - $this->y;
|
||||||
$dz = $newPos->z - $this->z;
|
$dz = $newPos->z - $this->z;
|
||||||
|
|
||||||
$this->setRotation($packet->yaw % 360, $packet->pitch % 360);
|
$packet->yaw %= 360;
|
||||||
|
$packet->pitch %= 360;
|
||||||
|
|
||||||
|
if($packet->yaw < 0){
|
||||||
|
$packet->yaw += 360;
|
||||||
|
}
|
||||||
|
|
||||||
|
if($packet->pitch < 0){
|
||||||
|
$packet->pitch += 360;
|
||||||
|
}
|
||||||
|
|
||||||
|
$this->setRotation($packet->yaw, $packet->pitch);
|
||||||
//$this->inBlock = $this->checkObstruction($this->x, ($this->boundingBox->minY + $this->boundingBox->maxY) / 2, $this->z);
|
//$this->inBlock = $this->checkObstruction($this->x, ($this->boundingBox->minY + $this->boundingBox->maxY) / 2, $this->z);
|
||||||
$this->move($dx, $dy, $dz);
|
$this->move($dx, $dy, $dz);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user