From 741182c55fe3ebc63a7d8c091a7f4406fb9bf2f5 Mon Sep 17 00:00:00 2001 From: Rush2929 <76860328+Rush2929@users.noreply.github.com> Date: Mon, 11 Apr 2022 05:02:21 +0900 Subject: [PATCH] InGamePacketHandler: skip processing movement if the player's position was changed during processing other properties (#4913) fixes #4952 --- src/network/mcpe/handler/InGamePacketHandler.php | 6 ++++-- tests/phpstan/configs/phpstan-bugs.neon | 5 +++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/network/mcpe/handler/InGamePacketHandler.php b/src/network/mcpe/handler/InGamePacketHandler.php index 92970604d..fe40ab6e8 100644 --- a/src/network/mcpe/handler/InGamePacketHandler.php +++ b/src/network/mcpe/handler/InGamePacketHandler.php @@ -228,8 +228,10 @@ class InGamePacketHandler extends PacketHandler{ $this->player->jump(); } - //TODO: this packet has WAYYYYY more useful information that we're not using - $this->player->handleMovement($newPos); + if(!$this->forceMoveSync){ + //TODO: this packet has WAYYYYY more useful information that we're not using + $this->player->handleMovement($newPos); + } $packetHandled = true; diff --git a/tests/phpstan/configs/phpstan-bugs.neon b/tests/phpstan/configs/phpstan-bugs.neon index 5233cf18d..4ade6cecd 100644 --- a/tests/phpstan/configs/phpstan-bugs.neon +++ b/tests/phpstan/configs/phpstan-bugs.neon @@ -85,3 +85,8 @@ parameters: count: 2 path: ../../../src/world/format/io/region/RegionLoader.php + - + message: "#^Negated boolean expression is always true\\.$#" + count: 1 + path: ../../../src/network/mcpe/handler/InGamePacketHandler.php +