diff --git a/src/game/Creature.cpp b/src/game/Creature.cpp index 0a71da145..d78187fa5 100644 --- a/src/game/Creature.cpp +++ b/src/game/Creature.cpp @@ -208,8 +208,8 @@ bool Creature::InitEntry(uint32 Entry, uint32 team, const CreatureData *data ) // difficulties for dungeons/battleground ordered in normal way // and if more high version not exist must be used lesser version // for raid order different: - // 10 man normal version must be used instead not existed 10 man heroic version - // 25 man normal version must be used instead not existed 25 man heroic version + // 10 man normal version must be used instead nonexistent 10 man heroic version + // 25 man normal version must be used instead nonexistent 25 man heroic version CreatureInfo const *cinfo = normalInfo; for (uint8 diff = uint8(GetMap()->GetDifficulty()); diff > 0;) { diff --git a/src/game/ObjectMgr.cpp b/src/game/ObjectMgr.cpp index cb6a4ad52..86c9372f5 100644 --- a/src/game/ObjectMgr.cpp +++ b/src/game/ObjectMgr.cpp @@ -299,6 +299,12 @@ void ObjectMgr::LoadCreatureLocales() uint32 entry = fields[0].GetUInt32(); + if (!GetCreatureTemplate(entry)) + { + ERROR_DB_STRICT_LOG("Table `locales_creature` has data for not existed creature entry %u, skipped.", entry); + continue; + } + CreatureLocale& data = mCreatureLocaleMap[entry]; for(int i = 1; i < MAX_LOCALE; ++i) @@ -368,6 +374,27 @@ void ObjectMgr::LoadGossipMenuItemsLocales() uint16 menuId = fields[0].GetUInt16(); uint16 id = fields[1].GetUInt16(); + GossipMenuItemsMapBounds bounds = GetGossipMenuItemsMapBounds(menuId); + + bool found = false; + if (bounds.first != bounds.second) + { + for (GossipMenuItemsMap::const_iterator itr = bounds.first; itr != bounds.second; ++itr) + { + if (itr->second.id == id) + { + found = true; + break; + } + } + } + + if (!found) + { + ERROR_DB_STRICT_LOG("Table `locales_gossip_menu_option` has data for nonexistent gossip menu %u item %u, skipped.", menuId, id); + continue; + } + GossipMenuItemsLocale& data = mGossipMenuItemsLocaleMap[MAKE_PAIR32(menuId,id)]; for(int i = 1; i < MAX_LOCALE; ++i) @@ -431,6 +458,12 @@ void ObjectMgr::LoadPointOfInterestLocales() uint32 entry = fields[0].GetUInt32(); + if (!GetPointOfInterest(entry)) + { + ERROR_DB_STRICT_LOG("Table `locales_points_of_interest` has data for nonexistent POI entry %u, skipped.", entry); + continue; + } + PointOfInterestLocale& data = mPointOfInterestLocaleMap[entry]; for(int i = 1; i < MAX_LOCALE; ++i) @@ -1769,6 +1802,12 @@ void ObjectMgr::LoadItemLocales() uint32 entry = fields[0].GetUInt32(); + if (!GetItemPrototype(entry)) + { + ERROR_DB_STRICT_LOG("Table `locales_item` has data for nonexistent item entry %u, skipped.", entry); + continue; + } + ItemLocale& data = mItemLocaleMap[entry]; for(int i = 1; i < MAX_LOCALE; ++i) @@ -4377,6 +4416,12 @@ void ObjectMgr::LoadQuestLocales() uint32 entry = fields[0].GetUInt32(); + if (!GetQuestTemplate(entry)) + { + ERROR_DB_STRICT_LOG("Table `locales_quest` has data for nonexistent quest entry %u, skipped.", entry); + continue; + } + QuestLocale& data = mQuestLocaleMap[entry]; for(int i = 1; i < MAX_LOCALE; ++i) @@ -5147,6 +5192,12 @@ void ObjectMgr::LoadPageTextLocales() uint32 entry = fields[0].GetUInt32(); + if (!sPageTextStore.LookupEntry(entry)) + { + ERROR_DB_STRICT_LOG("Table `locales_page_text` has data for nonexistent page text entry %u, skipped.", entry); + continue; + } + PageTextLocale& data = mPageTextLocaleMap[entry]; for(int i = 1; i < MAX_LOCALE; ++i) @@ -5335,6 +5386,12 @@ void ObjectMgr::LoadNpcTextLocales() uint32 entry = fields[0].GetUInt32(); + if (!GetGossipText(entry)) + { + ERROR_DB_STRICT_LOG("Table `locales_npc_text` has data for nonexistent gossip text entry %u, skipped.", entry); + continue; + } + NpcTextLocale& data = mNpcTextLocaleMap[entry]; for(int i=1; iisAffectedOnSpell(spellProto)) continue; - if ((*i)->GetModifier()->m_miscvalue == ) + if ((*i)->GetModifier()->m_miscvalue == ???) return false; } */ diff --git a/src/game/World.cpp b/src/game/World.cpp index 97a2b33ca..bd87e8a31 100644 --- a/src/game/World.cpp +++ b/src/game/World.cpp @@ -922,6 +922,7 @@ void World::SetInitialWorldSettings() sLog.outString("Initialize data stores..."); LoadDBCStores(m_dataPath); DetectDBCLang(); + sObjectMgr.SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts) sLog.outString( "Loading Script Names..."); sObjectMgr.LoadScriptNames(); @@ -944,19 +945,6 @@ void World::SetInitialWorldSettings() ///- Init highest guids before any guid using table loading to prevent using not initialized guids in some code. sObjectMgr.SetHighestGuids(); // must be after packing instances - - sLog.outString(); - sLog.outString( "Loading Localization strings..." ); - sObjectMgr.LoadCreatureLocales(); - sObjectMgr.LoadGameObjectLocales(); - sObjectMgr.LoadItemLocales(); - sObjectMgr.LoadQuestLocales(); - sObjectMgr.LoadNpcTextLocales(); - sObjectMgr.LoadPageTextLocales(); - sObjectMgr.LoadGossipMenuItemsLocales(); - sObjectMgr.LoadPointOfInterestLocales(); - sObjectMgr.SetDBCLocaleIndex(GetDefaultDbcLocale()); // Get once for all the locale index of DBC language (console/broadcasts) - sLog.outString( ">>> Localization strings loaded" ); sLog.outString(); sLog.outString( "Loading Page Texts..." ); @@ -972,7 +960,7 @@ void World::SetInitialWorldSettings() sSpellMgr.LoadSpellElixirs(); sLog.outString( "Loading Spell Learn Skills..." ); - sSpellMgr.LoadSpellLearnSkills(); // must be after LoadSpellChains + sSpellMgr.LoadSpellLearnSkills(); // must be after LoadSpellChains sLog.outString( "Loading Spell Learn Spells..." ); sSpellMgr.LoadSpellLearnSpells(); @@ -1014,7 +1002,7 @@ void World::SetInitialWorldSettings() sObjectMgr.LoadCreatureModelRace(); sLog.outString( "Loading SpellsScriptTarget..."); - sSpellMgr.LoadSpellScriptTarget(); // must be after LoadCreatureTemplates and LoadGameobjectInfo + sSpellMgr.LoadSpellScriptTarget(); // must be after LoadCreatureTemplates and LoadGameobjectInfo sLog.outString( "Loading ItemRequiredTarget..."); sObjectMgr.LoadItemRequiredTarget(); @@ -1042,7 +1030,7 @@ void World::SetInitialWorldSettings() sLog.outString( "Loading Creature Addon Data..." ); sLog.outString(); - sObjectMgr.LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures() + sObjectMgr.LoadCreatureAddons(); // must be after LoadCreatureTemplates() and LoadCreatures() sLog.outString( ">>> Creature Addon Data loaded" ); sLog.outString(); @@ -1062,14 +1050,14 @@ void World::SetInitialWorldSettings() sObjectMgr.LoadWeatherZoneChances(); sLog.outString( "Loading Quests..." ); - sObjectMgr.LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables + sObjectMgr.LoadQuests(); // must be loaded after DBCs, creature_template, item_template, gameobject tables sLog.outString( "Loading Quest POI" ); sObjectMgr.LoadQuestPOI(); sLog.outString( "Loading Quests Relations..." ); sLog.outString(); - sObjectMgr.LoadQuestRelations(); // must be after quest load + sObjectMgr.LoadQuestRelations(); // must be after quest load sLog.outString( ">>> Quests Relations loaded" ); sLog.outString(); @@ -1086,10 +1074,10 @@ void World::SetInitialWorldSettings() sSpellMgr.LoadSpellAreas(); sLog.outString( "Loading AreaTrigger definitions..." ); - sObjectMgr.LoadAreaTriggerTeleports(); // must be after item template load + sObjectMgr.LoadAreaTriggerTeleports(); // must be after item template load sLog.outString( "Loading Quest Area Triggers..." ); - sObjectMgr.LoadQuestAreaTriggers(); // must be after LoadQuests + sObjectMgr.LoadQuestAreaTriggers(); // must be after LoadQuests sLog.outString( "Loading Tavern Area Triggers..." ); sObjectMgr.LoadTavernAreaTriggers(); @@ -1161,6 +1149,45 @@ void World::SetInitialWorldSettings() sLog.outString( ">>> Achievements loaded" ); sLog.outString(); + sLog.outString( "Loading Npc Text Id..." ); + sObjectMgr.LoadNpcTextId(); // must be after load Creature and LoadGossipText + + sLog.outString( "Loading Gossip scripts..." ); + sObjectMgr.LoadGossipScripts(); // must be before gossip menu options + + sLog.outString( "Loading Gossip menus..." ); + sObjectMgr.LoadGossipMenu(); + + sLog.outString( "Loading Gossip menu options..." ); + sObjectMgr.LoadGossipMenuItems(); + + sLog.outString( "Loading Vendors..." ); + sObjectMgr.LoadVendorTemplates(); // must be after load ItemTemplate + sObjectMgr.LoadVendors(); // must be after load CreatureTemplate, VendorTemplate, and ItemTemplate + + sLog.outString( "Loading Trainers..." ); + sObjectMgr.LoadTrainerSpell(); // must be after load CreatureTemplate + + sLog.outString( "Loading Waypoint scripts..." ); // before loading from creature_movement + sObjectMgr.LoadCreatureMovementScripts(); + + sLog.outString( "Loading Waypoints..." ); + sLog.outString(); + sWaypointMgr.Load(); + + ///- Loading localization data + sLog.outString( "Loading Localization strings..." ); + sObjectMgr.LoadCreatureLocales(); // must be after CreatureInfo loading + sObjectMgr.LoadGameObjectLocales(); // must be after GameobjectInfo loading + sObjectMgr.LoadItemLocales(); // must be after ItemPrototypes loading + sObjectMgr.LoadQuestLocales(); // must be after QuestTemplates loading + sObjectMgr.LoadNpcTextLocales(); // must be after LoadGossipText + sObjectMgr.LoadPageTextLocales(); // must be after PageText loading + sObjectMgr.LoadGossipMenuItemsLocales(); // must be after gossip menu items loading + sObjectMgr.LoadPointOfInterestLocales(); // must be after POI loading + sLog.outString( ">>> Localization strings loaded" ); + sLog.outString(); + ///- Load dynamic data tables from the database sLog.outString( "Loading Auctions..." ); sLog.outString(); @@ -1193,32 +1220,6 @@ void World::SetInitialWorldSettings() sLog.outString( "Loading GameTeleports..." ); sObjectMgr.LoadGameTele(); - sLog.outString( "Loading Npc Text Id..." ); - sObjectMgr.LoadNpcTextId(); // must be after load Creature and NpcText - - sLog.outString( "Loading Gossip scripts..." ); - sObjectMgr.LoadGossipScripts(); // must be before gossip menu options - - sLog.outString( "Loading Gossip menus..." ); - sObjectMgr.LoadGossipMenu(); - - sLog.outString( "Loading Gossip menu options..." ); - sObjectMgr.LoadGossipMenuItems(); - - sLog.outString( "Loading Vendors..." ); - sObjectMgr.LoadVendorTemplates(); // must be after load ItemTemplate - sObjectMgr.LoadVendors(); // must be after load CreatureTemplate, VendorTemplate, and ItemTemplate - - sLog.outString( "Loading Trainers..." ); - sObjectMgr.LoadTrainerSpell(); // must be after load CreatureTemplate - - sLog.outString( "Loading Waypoint scripts..." ); // before loading from creature_movement - sObjectMgr.LoadCreatureMovementScripts(); - - sLog.outString( "Loading Waypoints..." ); - sLog.outString(); - sWaypointMgr.Load(); - sLog.outString( "Loading GM tickets..."); sTicketMgr.LoadGMTickets(); diff --git a/src/game/debugcmds.cpp b/src/game/debugcmds.cpp index 6d80714f1..dae0876bb 100644 --- a/src/game/debugcmds.cpp +++ b/src/game/debugcmds.cpp @@ -706,7 +706,7 @@ bool ChatHandler::HandleSetValueHelper(Object* target, uint32 field, char* typeS { ObjectGuid guid = target->GetObjectGuid(); - // not allow access to not existed or critical for work field + // not allow access to nonexistent or critical for work field if (field >= target->GetValuesCount() || field <= OBJECT_FIELD_ENTRY) { PSendSysMessage(LANG_TOO_BIG_INDEX, field, guid.GetString().c_str(), target->GetValuesCount()); @@ -909,7 +909,7 @@ bool ChatHandler::HandlerDebugModValueHelper( Object* target, uint32 field, char { ObjectGuid guid = target->GetObjectGuid(); - // not allow access to not existed or critical for work field + // not allow access to nonexistent or critical for work field if (field >= target->GetValuesCount() || field <= OBJECT_FIELD_ENTRY) { PSendSysMessage(LANG_TOO_BIG_INDEX, field, guid.GetString().c_str(), target->GetValuesCount()); diff --git a/src/shared/Log.h b/src/shared/Log.h index 0aaad2a77..b332d9b26 100644 --- a/src/shared/Log.h +++ b/src/shared/Log.h @@ -45,7 +45,7 @@ enum LogFilters LOG_FILTER_SQL_TEXT = 0x0040, // raw SQL text send to DB engine LOG_FILTER_PLAYER_MOVES = 0x0080, // player moves by grid/cell LOG_FILTER_PERIODIC_AFFECTS = 0x0100, // DoT/HoT apply trace - LOG_FILTER_AI_AND_MOVEGENSS = 0x0200, // DoT/HoT apply trace + LOG_FILTER_AI_AND_MOVEGENSS = 0x0200, // AI/movement generators debug output LOG_FILTER_DAMAGE = 0x0400, // Direct/Area damage trace LOG_FILTER_COMBAT = 0x0800, // attack states/roll attack results/etc LOG_FILTER_SPELL_CAST = 0x1000, // spell cast/aura apply/spell proc events diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index c4ea4b936..e90e09e10 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "10710" + #define REVISION_NR "10711" #endif // __REVISION_NR_H__