diff --git a/src/game/Object/ObjectMgr.cpp b/src/game/Object/ObjectMgr.cpp index ed6c76883..2492b0a2b 100644 --- a/src/game/Object/ObjectMgr.cpp +++ b/src/game/Object/ObjectMgr.cpp @@ -9408,27 +9408,30 @@ void ObjectMgr::LoadTrainerTemplates() bool hasErrored = false; for (CacheTrainerSpellMap::const_iterator tItr = m_mCacheTrainerTemplateSpellMap.begin(); tItr != m_mCacheTrainerTemplateSpellMap.end(); ++tItr) - trainer_ids.insert(tItr->first); + { trainer_ids.insert(tItr->first); } for (uint32 i = 1; i < sCreatureStorage.GetMaxEntry(); ++i) { if (CreatureInfo const* cInfo = sCreatureStorage.LookupEntry(i)) { + if (cInfo->TrainerTemplateId) + { if (m_mCacheTrainerTemplateSpellMap.find(cInfo->TrainerTemplateId) != m_mCacheTrainerTemplateSpellMap.end()) - trainer_ids.erase(cInfo->TrainerTemplateId); + { trainer_ids.erase(cInfo->TrainerTemplateId); } else { sLog.outErrorDb("Creature (Entry: %u) has TrainerTemplateId = %u for nonexistent trainer template", cInfo->Entry, cInfo->TrainerTemplateId); hasErrored = true; } + } } } for (std::set::const_iterator tItr = trainer_ids.begin(); tItr != trainer_ids.end(); ++tItr) - sLog.outErrorDb("Table `npc_trainer_template` has trainer template %u not used by any trainers ", *tItr); + { sLog.outErrorDb("Table `npc_trainer_template` has trainer template %u not used by any trainers ", *tItr); } if (hasErrored || !trainer_ids.empty()) // Append extra line in case of reported errors - sLog.outString(); + { sLog.outString(); } } void ObjectMgr::LoadVendors(char const* tableName, bool isTemplates) diff --git a/src/shared/revision.h b/src/shared/revision.h index ebcfcc887..5dda62ffb 100644 --- a/src/shared/revision.h +++ b/src/shared/revision.h @@ -37,7 +37,7 @@ #define CHAR_DB_UPDATE_DESCRIPTION "match_client_limits" #define WORLD_DB_VERSION_NR 21 - #define WORLD_DB_STRUCTURE_NR 3 - #define WORLD_DB_CONTENT_NR 0 - #define WORLD_DB_UPDATE_DESCRIPTION "script_binding populated" + #define WORLD_DB_STRUCTURE_NR 4 + #define WORLD_DB_CONTENT_NR 4 + #define WORLD_DB_UPDATE_DESCRIPTION "start up error fixes" #endif // __REVISION_H__