mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
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.
This commit is contained in:
parent
f018737b06
commit
7832b6843e
3 changed files with 15 additions and 35 deletions
|
@ -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);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue