From 7dbbef81ace80fe6751cf78cebd840c777f2c060 Mon Sep 17 00:00:00 2001 From: David Markowitz <39972741+EmosewaMC@users.noreply.github.com> Date: Sat, 4 Oct 2025 18:42:34 -0700 Subject: [PATCH] fix: regenerated proxy items dont need new ids and fix equip item ids (#1897) * fix: changed item ids not reflected in equipped items * dont do it for proxy items --- dGame/dInventory/Inventory.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/dGame/dInventory/Inventory.cpp b/dGame/dInventory/Inventory.cpp index 98e34f8d..db83ac58 100644 --- a/dGame/dInventory/Inventory.cpp +++ b/dGame/dInventory/Inventory.cpp @@ -324,10 +324,14 @@ Inventory::~Inventory() { void Inventory::RegenerateItemIDs() { std::map newItems{}; for (auto* const item : items | std::views::values) { + if (item->GetParent() != LWOOBJID_EMPTY) continue; // temp items dont need new ids + const bool equipped = item->IsEquipped(); + if (equipped) item->UnEquip(); const auto oldID = item->GetId(); const auto newID = item->GenerateID(); LOG("Updating item ID from %llu to %llu", oldID, newID); newItems.insert_or_assign(newID, item); + if (equipped) item->Equip(); } // We don't want to delete the item pointers, we're just moving from map to map