From 61b857a81c4fa29278f9baa303f23e9afe219387 Mon Sep 17 00:00:00 2001 From: "Dylan K. Taylor" Date: Sat, 10 Jun 2017 19:54:04 +0100 Subject: [PATCH] Fixed ExplodePacket fixed-float my ass! --- src/pocketmine/network/mcpe/protocol/ExplodePacket.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/pocketmine/network/mcpe/protocol/ExplodePacket.php b/src/pocketmine/network/mcpe/protocol/ExplodePacket.php index 7c6af7be5..ea4276a0b 100644 --- a/src/pocketmine/network/mcpe/protocol/ExplodePacket.php +++ b/src/pocketmine/network/mcpe/protocol/ExplodePacket.php @@ -35,6 +35,7 @@ class ExplodePacket extends DataPacket{ public $x; public $y; public $z; + /** @var float */ public $radius; /** @var Vector3[] */ public $records = []; @@ -46,7 +47,7 @@ class ExplodePacket extends DataPacket{ public function decode(){ $this->getVector3f($this->x, $this->y, $this->z); - $this->radius = $this->getLFloat(); + $this->radius = (float) ($this->getVarInt() / 32); $count = $this->getUnsignedVarInt(); for($i = 0; $i < $count; ++$i){ $x = $y = $z = null; @@ -58,7 +59,7 @@ class ExplodePacket extends DataPacket{ public function encode(){ $this->reset(); $this->putVector3f($this->x, $this->y, $this->z); - $this->putLFloat($this->radius); + $this->putVarInt((int) ($this->radius * 32)); $this->putUnsignedVarInt(count($this->records)); if(count($this->records) > 0){ foreach($this->records as $record){