fixed client crash using inf rot, fixed invisibility using nan rot

This commit is contained in:
GameHerobrine 2026-05-16 07:01:22 +03:00
parent 6f5d62f302
commit 171390260d

View file

@ -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