InGamePacketHandler: fix regression in movement handling since 82c8fa696a2e8609d8ae086c52f96abe7c7705b6

fixes #4291
fixes #4398
This commit is contained in:
Dylan K. Taylor 2021-09-10 16:52:27 +01:00
parent 4111d92b98
commit 7701e1ff98
No known key found for this signature in database
GPG Key ID: 8927471A91CAFD3D

View File

@ -177,7 +177,7 @@ class InGamePacketHandler extends PacketHandler{
$this->player->setRotation($yaw, $pitch);
$curPos = $this->player->getLocation();
$newPos = $packet->position->subtract(0, 1.62, 0);
$newPos = $packet->position->round(4)->subtract(0, 1.62, 0);
if($this->forceMoveSync and $newPos->distanceSquared($curPos) > 1){ //Tolerate up to 1 block to avoid problems with client-sided physics when spawning in blocks
$this->session->getLogger()->debug("Got outdated pre-teleport movement, received " . $newPos . ", expected " . $curPos);