aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorLars Müller <34514239+appgurueu@users.noreply.github.com>2022-05-09 20:43:47 +0200
committerGitHub <noreply@github.com>2022-05-09 20:43:47 +0200
commitc2898f53bc3eb1f22daf93b37608156885fe5c5a (patch)
treef58d1209913885611f5b507aa5e3231c6cc5b2bb /src
parent089797dbe68679b744304ba016e08d30df15ab28 (diff)
downloadminetest-c2898f53bc3eb1f22daf93b37608156885fe5c5a.tar.gz
minetest-c2898f53bc3eb1f22daf93b37608156885fe5c5a.tar.bz2
minetest-c2898f53bc3eb1f22daf93b37608156885fe5c5a.zip
HUD: Update selection mesh every frame (#12270)
Fixes outdated selection boxes after entity property changes.
Diffstat (limited to 'src')
-rw-r--r--src/client/game.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp
index 1e34ca286..f93bd34a3 100644
--- a/src/client/game.cpp
+++ b/src/client/game.cpp
@@ -3096,10 +3096,12 @@ void Game::processPlayerInteraction(f32 dtime, bool show_hud)
!runData.btn_down_for_dig,
camera_offset);
- if (pointed != runData.pointed_old) {
+ if (pointed != runData.pointed_old)
infostream << "Pointing at " << pointed.dump() << std::endl;
- hud->updateSelectionMesh(camera_offset);
- }
+
+ // Note that updating the selection mesh every frame is not particularly efficient,
+ // but the halo rendering code is already inefficient so there's no point in optimizing it here
+ hud->updateSelectionMesh(camera_offset);
// Allow digging again if button is not pressed
if (runData.digging_blocked && !isKeyDown(KeyType::DIG))