Skip to content

Commit

Permalink
fix: Add null check for vehicle rotation
Browse files Browse the repository at this point in the history
  • Loading branch information
TobiasGrether committed Aug 13, 2024
1 parent d98bf4d commit 27a0a6c
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/CorrectPlayerMovePredictionPacket.php
Original file line number Diff line number Diff line change
Expand Up @@ -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());
}
Expand Down

0 comments on commit 27a0a6c

Please sign in to comment.