diff options
author | ariel- <ariel-@users.noreply.github.com> | 2018-01-18 00:53:45 -0300 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-06-16 01:29:25 +0200 |
commit | 3bc3b3eeeb78fa8acc559730f9c45b0f237e4b2b (patch) | |
tree | d2a69894d0f57fded858481a0d93c611aa6a6a7c /src/server/game/Battlegrounds/BattlegroundMgr.cpp | |
parent | 21556667c16b282b77934bddee3d86f0c632ef31 (diff) |
Core/Globals: revert back to unordered_map for templates
Partial revert of commit b64c5043140dc7b7908e259e441de16cc0261320
See discussion on https://github.com/TrinityCore/TrinityCore/commit/b64c5043140dc7b7908e259e441de16cc0261320
(cherry picked from commit b75ff7d4bf13fb4778843c99521223becc096ca0)
Diffstat (limited to 'src/server/game/Battlegrounds/BattlegroundMgr.cpp')
-rw-r--r-- | src/server/game/Battlegrounds/BattlegroundMgr.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/server/game/Battlegrounds/BattlegroundMgr.cpp b/src/server/game/Battlegrounds/BattlegroundMgr.cpp index 269c8b6b992..8ed01ee23c1 100644 --- a/src/server/game/Battlegrounds/BattlegroundMgr.cpp +++ b/src/server/game/Battlegrounds/BattlegroundMgr.cpp @@ -750,15 +750,12 @@ void BattlegroundMgr::LoadBattleMastersEntry() void BattlegroundMgr::CheckBattleMasters() { CreatureTemplateContainer const& ctc = sObjectMgr->GetCreatureTemplates(); - for (auto const& creatureTemplate : ctc) + for (auto const& creatureTemplatePair : ctc) { - if (!creatureTemplate) - continue; - - if ((creatureTemplate->npcflag & UNIT_NPC_FLAG_BATTLEMASTER) && mBattleMastersMap.find(creatureTemplate->Entry) == mBattleMastersMap.end()) + if ((creatureTemplatePair.second.npcflag & UNIT_NPC_FLAG_BATTLEMASTER) && !mBattleMastersMap.count(creatureTemplatePair.first)) { - TC_LOG_ERROR("sql.sql", "Creature_Template Entry: %u has UNIT_NPC_FLAG_BATTLEMASTER, but no data in the `battlemaster_entry` table. Removing flag.", creatureTemplate->Entry); - const_cast<CreatureTemplate*>(creatureTemplate.get())->npcflag &= ~UNIT_NPC_FLAG_BATTLEMASTER; + TC_LOG_ERROR("sql.sql", "Creature_Template Entry: %u has UNIT_NPC_FLAG_BATTLEMASTER, but no data in the `battlemaster_entry` table. Removing flag.", creatureTemplatePair.first); + const_cast<CreatureTemplate&>(creatureTemplatePair.second).npcflag &= ~UNIT_NPC_FLAG_BATTLEMASTER; } } } |