mirror of
https://github.com/oldminecraftcommunity/NostalgiaCore.git
synced 2026-11-23 13:09:44 +00:00
fixed client crash using inf rot, fixed invisibility using nan rot
This commit is contained in:
parent
6f5d62f302
commit
171390260d
1 changed files with 13 additions and 0 deletions
|
|
@ -2432,6 +2432,19 @@ class Player{
|
||||||
break;
|
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){
|
if(($this->entity instanceof Entity) && $packet->messageIndex > $this->lastMovement){
|
||||||
$this->lastMovement = $packet->messageIndex;
|
$this->lastMovement = $packet->messageIndex;
|
||||||
//prevent all movement this far - vanilla collisions break there
|
//prevent all movement this far - vanilla collisions break there
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue