mirror of
https://github.com/pmmp/PocketMine-MP.git
synced 2025-07-04 09:10:00 +00:00
Fixed packets being discarded due to a bad ordering
This commit is contained in:
parent
cad9908f94
commit
80aaf9923c
@ -271,7 +271,7 @@ class Packet{
|
|||||||
$pk = new CustomPacketHandler($id, $pak);
|
$pk = new CustomPacketHandler($id, $pak);
|
||||||
$pk->data["length"] = $ln;
|
$pk->data["length"] = $ln;
|
||||||
$pk->data["id"] = $id;
|
$pk->data["id"] = $id;
|
||||||
$pk->data["counter"] = $messageNumber;
|
$pk->data["counter"] = $messageIndex;
|
||||||
$pk->data["packetName"] = $pk->name;
|
$pk->data["packetName"] = $pk->name;
|
||||||
$this->data["packets"][] = array($pid, $pk->data, $pak);
|
$this->data["packets"][] = array($pid, $pk->data, $pak);
|
||||||
}
|
}
|
||||||
|
@ -402,13 +402,13 @@ class Entity extends stdClass{
|
|||||||
if ($rotation < 0) {
|
if ($rotation < 0) {
|
||||||
$rotation += 360.0;
|
$rotation += 360.0;
|
||||||
}
|
}
|
||||||
if((0 <= $rotation and $rotation < 45) or (315 <= $rotation and $rotation < 360)) {
|
if((0 <= $rotation and $rotation < 45) or (315 <= $rotation and $rotation < 360)){
|
||||||
return 2; //North
|
return 2; //North
|
||||||
}elseif(45 <= $rotation and $rotation < 135) {
|
}elseif(45 <= $rotation and $rotation < 135){
|
||||||
return 3; //East
|
return 3; //East
|
||||||
}elseif(135 <= $rotation and $rotation < 225) {
|
}elseif(135 <= $rotation and $rotation < 225){
|
||||||
return 0; //South
|
return 0; //South
|
||||||
}elseif(225 <= $rotation and $rotation < 315) {
|
}elseif(225 <= $rotation and $rotation < 315){
|
||||||
return 1; //West
|
return 1; //West
|
||||||
}else{
|
}else{
|
||||||
return null;
|
return null;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user