Skip to content

Commit

Permalink
Fixed incorrect encoding of NpcDialoguePacket
Browse files Browse the repository at this point in the history
this is in fact an ActorUniqueID, but for some reason written as a uint64 instead of a varint.
  • Loading branch information
dktapps committed Jul 23, 2021
1 parent 3af1891 commit 5844b59
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/pocketmine/network/mcpe/protocol/NpcDialoguePacket.php
Expand Up @@ -64,7 +64,7 @@ public function getNpcName() : string{ return $this->npcName; }
public function getActionJson() : string{ return $this->actionJson; }

protected function decodePayload() : void{
$this->npcActorUniqueId = $this->getEntityUniqueId();
$this->npcActorUniqueId = $this->getLLong(); //WHY NOT USING STANDARD METHODS, MOJANG
$this->actionType = $this->getVarInt();
$this->dialogue = $this->getString();
$this->sceneName = $this->getString();
Expand All @@ -73,7 +73,7 @@ protected function decodePayload() : void{
}

protected function encodePayload() : void{
$this->putEntityUniqueId($this->npcActorUniqueId);
$this->putLLong($this->npcActorUniqueId);
$this->putVarInt($this->actionType);
$this->putString($this->dialogue);
$this->putString($this->sceneName);
Expand Down

0 comments on commit 5844b59

Please sign in to comment.