From 310dc9ebb239c10c455eb85a81ceccfd776bc000 Mon Sep 17 00:00:00 2001 From: GHOST11111100 Date: Sun, 27 Jul 2025 14:48:41 +0300 Subject: [PATCH] fix: correct tooltip comparison logic and streamline stack setting in SlotView --- src/graphics/ui/elements/InventoryView.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/graphics/ui/elements/InventoryView.cpp b/src/graphics/ui/elements/InventoryView.cpp index 563d36a7..6aadd3c4 100644 --- a/src/graphics/ui/elements/InventoryView.cpp +++ b/src/graphics/ui/elements/InventoryView.cpp @@ -153,7 +153,7 @@ static bool is_same_tooltip(const ItemStack& stack, const ItemStack& cache) { auto description = stack.getField("description"); auto cDescription = cache.getField("description"); - if (((caption != nullptr) != (description != nullptr)) || + if (((caption != nullptr) != (cCaption != nullptr)) || ((description != nullptr) != (cDescription != nullptr))) { return false; } @@ -250,7 +250,7 @@ void SlotView::draw(const DrawContext& pctx, const Assets& assets) { cache.countStr = std::to_wstring(stack.getCount()); } refreshTooltip(stack, item); - cache.stack.set(ItemStack(stack.getItemId(), stack.getCount())); + cache.stack.set(stack); glm::vec4 tint(1, 1, 1, isEnabled() ? 1 : 0.5f); glm::vec2 pos = calcPos();