From 156e5e74361a684dad5c82263f2b23b78b59d0d4 Mon Sep 17 00:00:00 2001 From: black-sliver <59490463+black-sliver@users.noreply.github.com> Date: Wed, 21 Feb 2024 21:12:28 +0100 Subject: [PATCH] Fix unnamed tooltip section not properly updating --- src/ui/maptooltip.cpp | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/src/ui/maptooltip.cpp b/src/ui/maptooltip.cpp index 0e0c8c17..4d41fcea 100644 --- a/src/ui/maptooltip.cpp +++ b/src/ui/maptooltip.cpp @@ -289,19 +289,19 @@ void MapTooltip::update(Tracker* tracker, std::functionsetTextColor(c); // NOTE: currently there will always be only one _sectionLocation since compact is always true - bool compact = true; - if (!_sectionLocations[i].empty()) { - int itemcount = sec.getItemCount() ; - int looted = sec.getItemCleared(); - bool opened = compact ? looted>=itemcount : i<=looted; - Item* w = _sectionLocations[i].front(); - if (itemcount!=1 && itemcount>looted) { - w->setOverlay(std::to_string(itemcount - looted)); - } else { - w->setOverlay(""); - } - w->setStage(opened?1:0,0); + } + bool compact = true; + if (!_sectionLocations[i].empty()) { + int itemcount = sec.getItemCount() ; + int looted = sec.getItemCleared(); + bool opened = compact ? looted>=itemcount : i<=looted; + Item* w = _sectionLocations[i].front(); + if (itemcount!=1 && itemcount>looted) { + w->setOverlay(std::to_string(itemcount - looted)); + } else { + w->setOverlay(""); } + w->setStage(opened?1:0,0); } i++; }