diff options
author | Lars Müller <34514239+appgurueu@users.noreply.github.com> | 2022-05-09 20:43:47 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2022-05-14 18:33:42 +0200 |
commit | 7bc2cde4ddd7a3e75a96d4bc77e5140b810d318f (patch) | |
tree | 50b099b83457989b9b974d4454620388d3023335 | |
parent | f065d3a06bcbf0cfe5ab4819a1d4d7cd05f96e79 (diff) | |
download | minetest-7bc2cde4ddd7a3e75a96d4bc77e5140b810d318f.tar.gz minetest-7bc2cde4ddd7a3e75a96d4bc77e5140b810d318f.tar.bz2 minetest-7bc2cde4ddd7a3e75a96d4bc77e5140b810d318f.zip |
HUD: Update selection mesh every frame (#12270)
Fixes outdated selection boxes after entity property changes.
-rw-r--r-- | src/client/game.cpp | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/client/game.cpp b/src/client/game.cpp index 9bbe36adf..768b1abad 100644 --- a/src/client/game.cpp +++ b/src/client/game.cpp @@ -3096,10 +3096,12 @@ void Game::processPlayerInteraction(f32 dtime, bool show_hud, bool show_debug) !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)) |