diff options
author | sfan5 <sfan5@live.de> | 2022-01-09 18:46:36 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-01-09 18:46:36 +0100 |
commit | 5eb45e1ea03c6104f007efec6dd9c351f310193d (patch) | |
tree | 28a40addf99493aedfbf67e4d85fa6cf88723419 /src/network | |
parent | 76dbd0d2d04712dcad4f7c6afecb97fa8d662d6d (diff) | |
download | minetest-5eb45e1ea03c6104f007efec6dd9c351f310193d.tar.gz minetest-5eb45e1ea03c6104f007efec6dd9c351f310193d.tar.bz2 minetest-5eb45e1ea03c6104f007efec6dd9c351f310193d.zip |
Restore pass-through of direction keys (#11924)
This moves relevant code into the PlayerControl class and gets rid of separate keyPressed variable.
Diffstat (limited to 'src/network')
-rw-r--r-- | src/network/serverpackethandler.cpp | 9 |
1 files changed, 1 insertions, 8 deletions
diff --git a/src/network/serverpackethandler.cpp b/src/network/serverpackethandler.cpp index e5a1bab1e..37b62c5cb 100644 --- a/src/network/serverpackethandler.cpp +++ b/src/network/serverpackethandler.cpp @@ -482,7 +482,6 @@ void Server::process_PlayerPos(RemotePlayer *player, PlayerSAO *playersao, f32 yaw = (f32)f32yaw / 100.0f; u32 keyPressed = 0; - // default behavior (in case an old client doesn't send these) f32 fov = 0; u8 wanted_range = 0; @@ -508,13 +507,7 @@ void Server::process_PlayerPos(RemotePlayer *player, PlayerSAO *playersao, playersao->setFov(fov); playersao->setWantedRange(wanted_range); - player->keyPressed = keyPressed; - player->control.jump = (keyPressed & (0x1 << 4)); - player->control.aux1 = (keyPressed & (0x1 << 5)); - player->control.sneak = (keyPressed & (0x1 << 6)); - player->control.dig = (keyPressed & (0x1 << 7)); - player->control.place = (keyPressed & (0x1 << 8)); - player->control.zoom = (keyPressed & (0x1 << 9)); + player->control.unpackKeysPressed(keyPressed); if (playersao->checkMovementCheat()) { // Call callbacks |