aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2023-09-19 10:59:04 +0200
committerShauren <shauren.trinity@gmail.com>2023-09-19 10:59:04 +0200
commit47fc3cb852324119e81c01015b7cc4f39d43e559 (patch)
tree033cdd8511b6b5e46a9fdbb3a847ce43f3179180 /src/server/scripts/Commands
parentfa77874ffba8c0ce92d6d01414bd3d164506cfa5 (diff)
Core/Instances: Kill instance_encounters table, it is no longer neccessary
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_go.cpp11
1 files changed, 4 insertions, 7 deletions
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<uint32, CreatureTemplate const*> matches;
+ std::multimap<uint32, CreatureTemplate const*, std::greater<uint32>> matches;
std::unordered_map<uint32, std::vector<CreatureData const*>> 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<CreatureData const*> const& spawns = spawnLookup[boss->Entry];
ASSERT(!spawns.empty());