Changeset 28 for trunk/src/game/ObjectMgr.cpp
- Timestamp:
- 11/19/08 13:24:39 (17 years ago)
- Files:
-
- 1 modified
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/game/ObjectMgr.cpp
r18 r28 6680 6680 m_mCacheTrainerSpellMap.clear(); 6681 6681 6682 std::set<uint32> skip_trainers; 6683 6682 6684 QueryResult *result = WorldDatabase.PQuery("SELECT entry, spell,spellcost,reqskill,reqskillvalue,reqlevel FROM npc_trainer"); 6683 6685 … … 6715 6717 if(!(cInfo->npcflag & UNIT_NPC_FLAG_TRAINER)) 6716 6718 { 6717 sLog.outErrorDb("Table `npc_trainer` have data for not creature template (Entry: %u) without trainer flag, ignore", entry); 6719 if(skip_trainers.count(entry) == 0) 6720 { 6721 sLog.outErrorDb("Table `npc_trainer` have data for not creature template (Entry: %u) without trainer flag, ignore", entry); 6722 skip_trainers.insert(entry); 6723 } 6718 6724 continue; 6719 6725 } … … 6765 6771 m_mCacheVendorItemMap.clear(); 6766 6772 6773 std::set<uint32> skip_vendors; 6774 6767 6775 QueryResult *result = WorldDatabase.PQuery("SELECT entry, item, maxcount, incrtime, ExtendedCost FROM npc_vendor"); 6768 6776 if( !result ) … … 6791 6799 uint32 ExtendedCost = fields[4].GetUInt32(); 6792 6800 6793 if(!IsVendorItemValid(entry,item_id,maxcount,incrtime,ExtendedCost ))6801 if(!IsVendorItemValid(entry,item_id,maxcount,incrtime,ExtendedCost,NULL,&skip_vendors)) 6794 6802 continue; 6795 6803 … … 6879 6887 } 6880 6888 6881 bool ObjectMgr::IsVendorItemValid( uint32 vendor_entry, uint32 item_id, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* pl ) const6889 bool ObjectMgr::IsVendorItemValid( uint32 vendor_entry, uint32 item_id, uint32 maxcount, uint32 incrtime, uint32 ExtendedCost, Player* pl, std::set<uint32>* skip_vendors ) const 6882 6890 { 6883 6891 CreatureInfo const* cInfo = GetCreatureTemplate(vendor_entry); … … 6893 6901 if(!(cInfo->npcflag & UNIT_NPC_FLAG_VENDOR)) 6894 6902 { 6895 if(pl) 6896 ChatHandler(pl).SendSysMessage(LANG_COMMAND_VENDORSELECTION); 6897 else 6898 sLog.outErrorDb("Table `npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry); 6903 if(!skip_vendors || skip_vendors->count(vendor_entry)==0) 6904 { 6905 if(pl) 6906 ChatHandler(pl).SendSysMessage(LANG_COMMAND_VENDORSELECTION); 6907 else 6908 sLog.outErrorDb("Table `npc_vendor` have data for not creature template (Entry: %u) without vendor flag, ignore", vendor_entry); 6909 6910 if(skip_vendors) 6911 skip_vendors->insert(vendor_entry); 6912 } 6899 6913 return false; 6900 6914 }