From 47fc3cb852324119e81c01015b7cc4f39d43e559 Mon Sep 17 00:00:00 2001 From: Shauren Date: Tue, 19 Sep 2023 10:59:04 +0200 Subject: Core/Instances: Kill instance_encounters table, it is no longer neccessary --- src/server/scripts/Commands/cs_go.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'src/server/scripts/Commands') diff --git a/src/server/scripts/Commands/cs_go.cpp b/src/server/scripts/Commands/cs_go.cpp index fc78d8dc93d..5ab5395612f 100644 --- a/src/server/scripts/Commands/cs_go.cpp +++ b/src/server/scripts/Commands/cs_go.cpp @@ -520,16 +520,13 @@ public: if (needles.empty()) return false; - std::multimap matches; + std::multimap> matches; std::unordered_map> spawnLookup; // find all boss flagged mobs that match our needles for (auto const& pair : sObjectMgr->GetCreatureTemplates()) { CreatureTemplate const& data = pair.second; - if (!(data.flags_extra & CREATURE_FLAG_EXTRA_DUNGEON_BOSS)) - continue; - uint32 count = 0; std::string const& scriptName = sObjectMgr->GetScriptName(data.ScriptID); for (std::string_view label : needles) @@ -539,7 +536,7 @@ public: if (count) { matches.emplace(count, &data); - (void)spawnLookup[data.Entry]; // inserts default-constructed vector + spawnLookup.try_emplace(data.Entry); // inserts default-constructed vector } } @@ -567,7 +564,7 @@ public: } // see if we have multiple equal matches left - auto it = matches.crbegin(), end = matches.crend(); + auto it = matches.cbegin(), end = matches.cend(); uint32 const maxCount = it->first; if ((++it) != end && it->first == maxCount) { @@ -580,7 +577,7 @@ public: return false; } - CreatureTemplate const* const boss = matches.crbegin()->second; + CreatureTemplate const* const boss = matches.cbegin()->second; std::vector const& spawns = spawnLookup[boss->Entry]; ASSERT(!spawns.empty()); -- cgit v1.2.3