From ebb9a9f1ca3f98c1cd7dd879e8db4c0d1d3fd74b Mon Sep 17 00:00:00 2001 From: T1ti <40864460+T1ti@users.noreply.github.com> Date: Thu, 18 Jul 2024 03:39:59 +0200 Subject: [PATCH] fix details info window update check --- src/noggit/MapView.cpp | 19 ++++--------------- 1 file changed, 4 insertions(+), 15 deletions(-) diff --git a/src/noggit/MapView.cpp b/src/noggit/MapView.cpp index 1856253c..f9b261d8 100755 --- a/src/noggit/MapView.cpp +++ b/src/noggit/MapView.cpp @@ -1063,10 +1063,6 @@ void MapView::updateDetailInfos() { if (!current_selection.empty()) { - std::uintptr_t previous_sel_last = 0; - if (!lastSelected.empty()) - previous_sel_last = reinterpret_cast(&const_cast(lastSelected.back())); - selection_type& selection_last = const_cast(current_selection.back()); switch (selection_last.index()) @@ -1074,21 +1070,13 @@ void MapView::updateDetailInfos() case eEntry_Object: { auto obj = std::get(selection_last); - - if (reinterpret_cast(obj) != previous_sel_last || NOGGIT_CUR_ACTION) - { - obj->updateDetails(guidetailInfos); - } + obj->updateDetails(guidetailInfos); break; } case eEntry_MapChunk: { selected_chunk_type& chunk_sel(std::get(selection_last)); - - if (reinterpret_cast(chunk_sel.chunk) != previous_sel_last || NOGGIT_CUR_ACTION) - { - chunk_sel.updateDetails(guidetailInfos); - } + chunk_sel.updateDetails(guidetailInfos); break; } } @@ -4549,7 +4537,8 @@ void MapView::tick (float dt) } } - updateDetailInfos(); // checks if sel changed + if (selection_changed || NOGGIT_CUR_ACTION) + updateDetailInfos(); // checks if sel changed if (selection_changed) {