From a6ed4350381ec857a35853c3637cd2fef92aae39 Mon Sep 17 00:00:00 2001 From: EmosewaMC <39972741+EmosewaMC@users.noreply.github.com> Date: Sun, 6 Feb 2022 20:53:45 -0800 Subject: [PATCH] Added bounds check for proxies --- dGame/dComponents/InventoryComponent.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dGame/dComponents/InventoryComponent.cpp b/dGame/dComponents/InventoryComponent.cpp index 922b2de3..e7183da2 100644 --- a/dGame/dComponents/InventoryComponent.cpp +++ b/dGame/dComponents/InventoryComponent.cpp @@ -1010,7 +1010,7 @@ void InventoryComponent::EquipItem(Item* item, const bool skipChecks) UpdateSlot(item->GetInfo().equipLocation, { item->GetId(), item->GetLot(), item->GetCount(), item->GetSlot() }); - ApplyBuff(item->GetLot()); + if (item->GetParent() == LWOOBJID_EMPTY) ApplyBuff(item->GetLot()); AddItemSkills(item->GetLot()); @@ -1038,7 +1038,7 @@ void InventoryComponent::UnEquipItem(Item* item) set->OnUnEquip(lot); } - RemoveBuff(item->GetLot()); + if (item->GetParent() == LWOOBJID_EMPTY) RemoveBuff(item->GetLot()); RemoveItemSkills(item->GetLot()); @@ -1498,7 +1498,7 @@ std::vector InventoryComponent::GenerateProxies(Item* parent) auto* inventory = GetInventory(ITEM_SETS); - auto* proxy = new Item(lot, inventory, inventory->FindEmptySlot(), 1, {}, parent->GetId(), false); + auto* proxy = new Item(lot, inventory, inventory->FindEmptySlot(), 1, {}, parent->GetId(), false, parent->GetId()); EquipItem(proxy);