Skip to content

Commit

Permalink
HUD: Update selection mesh every frame (minetest#12270)
Browse files Browse the repository at this point in the history
Fixes outdated selection boxes after entity property changes.
  • Loading branch information
appgurueu committed May 9, 2022
1 parent 089797d commit c2898f5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/client/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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))
Expand Down

0 comments on commit c2898f5

Please sign in to comment.