diff options
author | click <none@none> | 2010-04-30 22:35:37 +0200 |
---|---|---|
committer | click <none@none> | 2010-04-30 22:35:37 +0200 |
commit | 697685c3f57ffb9498e1a957333ea4fa6dd87b9a (patch) | |
tree | 096cbf097c629f7f48c00a16520db601ba5e6782 /src/game/ObjectMgr.cpp | |
parent | 4b1a9916acb8d2a8281346a430ee178434ec0c4b (diff) |
Add support for vendors selling the same items with different extendedCost - original code by Vladimir (thanks mate)
Closes issue #1756
--HG--
branch : trunk
Diffstat (limited to 'src/game/ObjectMgr.cpp')
-rw-r--r-- | src/game/ObjectMgr.cpp | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index bc4b5cac9ec..94d735f10f0 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -8617,10 +8617,9 @@ bool ObjectMgr::RemoveVendorItem(uint32 entry,uint32 item, bool savetodb) if (iter == m_mCacheVendorItemMap.end()) return false; - if (!iter->second.FindItem(item)) + if(!iter->second.RemoveItem(item)) return false; - iter->second.RemoveItem(item); if (savetodb) WorldDatabase.PExecuteLog("DELETE FROM npc_vendor WHERE entry='%u' AND item='%u'",entry, item); return true; } @@ -8691,12 +8690,12 @@ bool ObjectMgr::IsVendorItemValid(uint32 vendor_entry, uint32 item_id, int32 max if (!vItems) return true; // later checks for non-empty lists - if (vItems->FindItem(item_id)) + if(vItems->FindItemCostPair(item_id,ExtendedCost)) { if (pl) - ChatHandler(pl).PSendSysMessage(LANG_ITEM_ALREADY_IN_LIST,item_id); + ChatHandler(pl).PSendSysMessage(LANG_ITEM_ALREADY_IN_LIST, item_id, ExtendedCost); else - sLog.outErrorDb("Table `(game_event_)npc_vendor` has duplicate items %u for vendor (Entry: %u), ignore", item_id, vendor_entry); + sLog.outErrorDb( "Table `npc_vendor` has duplicate items %u (with extended cost %u) for vendor (Entry: %u), ignoring", item_id, ExtendedCost, vendor_entry); return false; } |