Merge pull request #441 from EmosewaMC/ProxyItemFix

Addressed some proxy items granting duplicate skills
This commit is contained in:
Daniel Seiler 2022-03-26 08:17:04 +01:00 committed by GitHub
commit 66b7c6522e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View File

@ -1043,7 +1043,7 @@ void InventoryComponent::EquipItem(Item* item, const bool skipChecks)
UpdateSlot(item->GetInfo().equipLocation, { item->GetId(), item->GetLot(), item->GetCount(), item->GetSlot() }); 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()); AddItemSkills(item->GetLot());
@ -1071,7 +1071,7 @@ void InventoryComponent::UnEquipItem(Item* item)
set->OnUnEquip(lot); set->OnUnEquip(lot);
} }
RemoveBuff(item->GetLot()); if (item->GetParent() == LWOOBJID_EMPTY) RemoveBuff(item->GetLot());
RemoveItemSkills(item->GetLot()); RemoveItemSkills(item->GetLot());
@ -1531,7 +1531,7 @@ std::vector<Item*> InventoryComponent::GenerateProxies(Item* parent)
auto* inventory = GetInventory(ITEM_SETS); 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); EquipItem(proxy);

View File

@ -407,8 +407,8 @@ private:
std::vector<Item*> FindProxies(LWOOBJID parent); std::vector<Item*> FindProxies(LWOOBJID parent);
/** /**
* Returns if the provided ID is a valid proxy item (e.g. we have children for it) * Returns true if the provided LWOOBJID is the parent of this Item.
* @param parent the parent item to check for * @param parent the parent item to check for proxies
* @return if the provided ID is a valid proxy item * @return if the provided ID is a valid proxy item
*/ */
bool IsValidProxy(LWOOBJID parent); bool IsValidProxy(LWOOBJID parent);