Skip to content

Commit

Permalink
DisconnectPacket: fixed message not being initialized if not provided…
Browse files Browse the repository at this point in the history
… during decode (#224)
  • Loading branch information
BrandPVP authored Feb 20, 2024
1 parent ae8579f commit 0f3ebf1
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions src/DisconnectPacket.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,7 @@ public function canBeSentBeforeLogin() : bool{
protected function decodePayload(PacketSerializer $in) : void{
$this->reason = $in->getVarInt();
$hideDisconnectionScreen = $in->getBool();
if(!$hideDisconnectionScreen){
$this->message = $in->getString();
}
$this->message = $hideDisconnectionScreen ? null : $in->getString();
}

protected function encodePayload(PacketSerializer $out) : void{
Expand Down

0 comments on commit 0f3ebf1

Please sign in to comment.