aboutsummaryrefslogtreecommitdiff
path: root/src/network
diff options
context:
space:
mode:
authorSmallJoker <SmallJoker@users.noreply.github.com>2021-02-15 20:41:19 +0100
committerGitHub <noreply@github.com>2021-02-15 20:41:19 +0100
commit7832b6843e73410e15677d1324d582b4b7c7e824 (patch)
tree2b7ab359ecb16a43e37dffdbf591d8a930ec0235 /src/network
parentf018737b0646e0961a46a74765945d6039e47b88 (diff)
downloadminetest-7832b6843e73410e15677d1324d582b4b7c7e824.tar.gz
minetest-7832b6843e73410e15677d1324d582b4b7c7e824.tar.bz2
minetest-7832b6843e73410e15677d1324d582b4b7c7e824.zip
Server-side authority for attached players (#10952)
The server must have authority about attachments. This commit ignores any player movement packets as long they're attached.
Diffstat (limited to 'src/network')
-rw-r--r--src/network/serverpackethandler.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp
index 270b8e01f..ddc6f4e47 100644
--- a/src/network/serverpackethandler.cpp
+++ b/src/network/serverpackethandler.cpp
@@ -488,8 +488,12 @@ void Server::process_PlayerPos(RemotePlayer *player, PlayerSAO *playersao,
pitch = modulo360f(pitch);
yaw = wrapDegrees_0_360(yaw);
- playersao->setBasePosition(position);
- player->setSpeed(speed);
+ if (!playersao->isAttached()) {
+ // Only update player positions when moving freely
+ // to not interfere with attachment handling
+ playersao->setBasePosition(position);
+ player->setSpeed(speed);
+ }
playersao->setLookPitch(pitch);
playersao->setPlayerYaw(yaw);
playersao->setFov(fov);