From 80aaf9923c65b5508a69d051321bf98fc425e6ca Mon Sep 17 00:00:00 2001 From: Shoghi Cervantes Pueyo Date: Sun, 14 Apr 2013 23:19:55 +0200 Subject: [PATCH] Fixed packets being discarded due to a bad ordering --- src/network/Packet.php | 2 +- src/world/Entity.php | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/network/Packet.php b/src/network/Packet.php index d6579599..9a58c3da 100644 --- a/src/network/Packet.php +++ b/src/network/Packet.php @@ -271,7 +271,7 @@ class Packet{ $pk = new CustomPacketHandler($id, $pak); $pk->data["length"] = $ln; $pk->data["id"] = $id; - $pk->data["counter"] = $messageNumber; + $pk->data["counter"] = $messageIndex; $pk->data["packetName"] = $pk->name; $this->data["packets"][] = array($pid, $pk->data, $pak); } diff --git a/src/world/Entity.php b/src/world/Entity.php index 1b107b4f..9ea4509d 100644 --- a/src/world/Entity.php +++ b/src/world/Entity.php @@ -402,13 +402,13 @@ class Entity extends stdClass{ if ($rotation < 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 - }elseif(45 <= $rotation and $rotation < 135) { + }elseif(45 <= $rotation and $rotation < 135){ return 3; //East - }elseif(135 <= $rotation and $rotation < 225) { + }elseif(135 <= $rotation and $rotation < 225){ return 0; //South - }elseif(225 <= $rotation and $rotation < 315) { + }elseif(225 <= $rotation and $rotation < 315){ return 1; //West }else{ return null;