From eae9a70385d0cafde1df178c7be12f33dd09689d Mon Sep 17 00:00:00 2001 From: grorp Date: Sat, 31 Aug 2024 20:45:32 +0200 Subject: [PATCH] TouchControls: Fix outdated player controls in TOSERVER_INTERACT --- src/client/game.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/client/game.cpp b/src/client/game.cpp index 53871d5ac..0a9b4ec58 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -3358,6 +3358,10 @@ void Game::processPlayerInteraction(f32 dtime, bool show_hud) if (g_touchcontrols) { auto mode = selected_def.touch_interaction.getMode(pointed.type); g_touchcontrols->applyContextControls(mode); + // applyContextControls may change dig/place input. + // Update again so that TOSERVER_INTERACT packets have the correct controls set. + player->control.dig = isKeyDown(KeyType::DIG); + player->control.place = isKeyDown(KeyType::PLACE); } // Note that updating the selection mesh every frame is not particularly efficient,