From 8cd6416754a389f52eb09cd50b589de9656007f5 Mon Sep 17 00:00:00 2001 From: Uleat Date: Sun, 12 Mar 2017 14:20:22 -0400 Subject: [PATCH] Added ItemData::CheckLoreConflict() --- common/item_data.cpp | 18 ++++++++++++++++++ common/item_data.h | 3 +++ 2 files changed, 21 insertions(+) diff --git a/common/item_data.cpp b/common/item_data.cpp index e23f962d2..c0e70d72a 100644 --- a/common/item_data.cpp +++ b/common/item_data.cpp @@ -207,3 +207,21 @@ bool EQEmu::ItemData::IsTypeShield() const { return (ItemType == item::ItemTypeShield); } + +bool EQEmu::ItemData::CheckLoreConflict(const ItemData* l_item, const ItemData* r_item) +{ + if (!l_item || !r_item) + return false; + + if (!l_item->LoreGroup || !r_item->LoreGroup) + return false; + + if (l_item->LoreGroup == r_item->LoreGroup) { + if ((l_item->LoreGroup == -1) && (l_item->ID != r_item->ID)) + return false; + + return true; + } + + return false; +} diff --git a/common/item_data.h b/common/item_data.h index 14aa368c2..e5d1a24f2 100644 --- a/common/item_data.h +++ b/common/item_data.h @@ -538,6 +538,9 @@ namespace EQEmu bool IsType1HWeapon() const; bool IsType2HWeapon() const; bool IsTypeShield() const; + + static bool CheckLoreConflict(const ItemData* l_item, const ItemData* r_item); + bool CheckLoreConflict(const ItemData* item) const { return CheckLoreConflict(this, item); } }; } /*EQEmu*/