From 171390260dab425b037d82faafdc2659198ffc97 Mon Sep 17 00:00:00 2001 From: GameHerobrine Date: Sat, 16 May 2026 07:01:22 +0300 Subject: [PATCH] fixed client crash using inf rot, fixed invisibility using nan rot --- src/Player.php | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/Player.php b/src/Player.php index 89b3a716..4ad26a57 100755 --- a/src/Player.php +++ b/src/Player.php @@ -2432,6 +2432,19 @@ class Player{ break; } + if(is_infinite($packet->yaw) || is_infinite($packet->pitch) || is_infinite($packet->bodyYaw)){ + ConsoleAPI::warn("{$this->username} Attempted to crash other clients using INF rotation!"); + $this->close("invalid rotation"); + break; + } + + //doesnt crash anything but allows players to break their model rendering(make them/head invisible) + if(is_nan($packet->yaw) || is_nan($packet->pitch) || is_nan($packet->bodyYaw)){ + ConsoleAPI::warn("{$this->username} Attempted to break their model using NAN rotation!"); + $this->close("invalid rotation"); + break; + } + if(($this->entity instanceof Entity) && $packet->messageIndex > $this->lastMovement){ $this->lastMovement = $packet->messageIndex; //prevent all movement this far - vanilla collisions break there