From 34fb490e7d2404d0c89bd6c6a400f19089959694 Mon Sep 17 00:00:00 2001 From: Pedro Henrique Alves Cruz Date: Wed, 14 Aug 2024 23:14:02 -0300 Subject: [PATCH] fix: ignore items with elevation --- source/main_menubar.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/source/main_menubar.cpp b/source/main_menubar.cpp index bb359f71..2b1119ee 100644 --- a/source/main_menubar.cpp +++ b/source/main_menubar.cpp @@ -2400,7 +2400,7 @@ namespace SearchDuplicatedItems { if (foundTiles.count(tile) == 0) { std::unordered_set itemIDs; for (Item* existingItem : tile->items) { - if (itemIDs.count(existingItem->getID()) > 0) { + if (itemIDs.count(existingItem->getID()) > 0 && !existingItem->hasElevation()) { foundTiles.insert(tile); break; } @@ -2466,9 +2466,9 @@ namespace RemoveDuplicatesItems { } std::unordered_set itemIDsDuplicates; - for (Item* itemInTile : tile->items) { + for (const auto &itemInTile : tile->items) { if (itemInTile && itemInTile->getID() == item->getID()) { - if (itemIDsDuplicates.count(itemInTile->getID()) > 0) { + if (itemIDsDuplicates.count(itemInTile->getID()) > 0 && !itemInTile->hasElevation()) { itemIDsDuplicates.clear(); return true; }