hopefully fixed yaw/pitch rotation + new ai task can be randomly executed now

This commit is contained in:
GameHerobrine 2022-12-20 19:23:21 +03:00
parent 1b85ffd4c6
commit d9c096357a
7 changed files with 69 additions and 44 deletions

View file

@ -3,7 +3,13 @@
class RotateHeadPacket extends RakNetDataPacket{
public $eid;
public $yaw;
/**
* Should yaw be modifed<br>
* false = <b>yaw / 360 / 0.0039062</b><br>
* true = <b>yaw</b>
* @var boolean
*/
public $rawYaw = false;
public function pid(){
return ProtocolInfo::ROTATE_HEAD_PACKET;
}
@ -15,7 +21,7 @@ class RotateHeadPacket extends RakNetDataPacket{
public function encode(){
$this->reset();
$this->putInt($this->eid);
$this->putByte($this->yaw);
@$this->putByte($this->rawYaw ? $this->yaw : $this->yaw / 360 / 0.0039062); //dont ask me why does chr count float TODO find a better way
}
}