]> git.lizzy.rs Git - dragonfireclient.git/commitdiff
HUD: Update selection mesh every frame (#12270)
authorLars Müller <34514239+appgurueu@users.noreply.github.com>
Mon, 9 May 2022 18:43:47 +0000 (20:43 +0200)
committerGitHub <noreply@github.com>
Mon, 9 May 2022 18:43:47 +0000 (20:43 +0200)
Fixes outdated selection boxes after entity property changes.

src/client/game.cpp

index 1e34ca286f115e77864814603c9f3b45e8d23c53..f93bd34a3b6ff56fb88fddded059bb525adffd3f 100644 (file)
@@ -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))