From 27a0a6c5234b21d9761f6b92a30098d7d94e4757 Mon Sep 17 00:00:00 2001 From: Tobias Grether Date: Tue, 13 Aug 2024 15:53:26 +0200 Subject: [PATCH] fix: Add null check for vehicle rotation --- src/CorrectPlayerMovePredictionPacket.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/CorrectPlayerMovePredictionPacket.php b/src/CorrectPlayerMovePredictionPacket.php index 0a690846..0fd2f787 100644 --- a/src/CorrectPlayerMovePredictionPacket.php +++ b/src/CorrectPlayerMovePredictionPacket.php @@ -76,7 +76,7 @@ protected function encodePayload(PacketSerializer $out) : void{ $out->putByte($this->predictionType); $out->putVector3($this->position); $out->putVector3($this->delta); - if($this->predictionType === self::PREDICTION_TYPE_VEHICLE) { + if($this->predictionType === self::PREDICTION_TYPE_VEHICLE && $this->vehicleRotation != null) { $out->putFloat($this->vehicleRotation->getX()); $out->putFloat($this->vehicleRotation->getY()); }