aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2025-02-23 12:10:33 +0100
committerShauren <shauren.trinity@gmail.com>2025-02-23 12:10:33 +0100
commit00223f3bee137f3b3f3a8e0ec33b634b4511cc0b (patch)
treed767096f97496c162a9e1d9e9f0f750a011d50fa /src/server/game/Globals/ObjectMgr.cpp
parent67418a1aeee9035234d304b5e9653b832488dd66 (diff)
Core/Misc: Add a bunch of examples for 67418a1aeee9035234d304b5e9653b832488dd66
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index bf48d936f62..114fa01dbdd 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -72,6 +72,7 @@
#include "VMapManager2.h"
#include "Vehicle.h"
#include "World.h"
+#include "advstd.h"
#include <G3D/g3dmath.h>
#include <limits>
#include <numeric>
@@ -1528,7 +1529,7 @@ void ObjectMgr::LoadEquipmentTemplates()
continue;
}
- if (std::ranges::none_of(InventoryTypesEquipable, [dbcItem](InventoryType inventoryType) { return inventoryType == dbcItem->InventoryType; }))
+ if (!advstd::ranges::contains(InventoryTypesEquipable, dbcItem->InventoryType))
{
TC_LOG_ERROR("sql.sql", "Item (ID={}) in creature_equip_template.ItemID{} for CreatureID = {} and ID = {} is not equipable in a hand, forced to 0.",
equipmentInfo.Items[i].ItemId, i + 1, entry, id);
@@ -11776,13 +11777,9 @@ SpawnTrackingTemplateData const* ObjectMgr::GetSpawnTrackingData(uint32 spawnTra
bool ObjectMgr::IsQuestObjectiveForSpawnTracking(uint32 spawnTrackingId, uint32 questObjectiveId) const
{
- auto itr = _spawnTrackingQuestObjectiveStore.find(spawnTrackingId);
- if (itr != _spawnTrackingQuestObjectiveStore.end())
- {
- std::vector<QuestObjective const*> const* questObjectiveList = &itr->second;
- if (std::ranges::find(*questObjectiveList, questObjectiveId, &QuestObjective::ID) != (*questObjectiveList).end())
- return true;
- }
+ if (std::vector<QuestObjective const*> const* questObjectiveList = Trinity::Containers::MapGetValuePtr(_spawnTrackingQuestObjectiveStore, spawnTrackingId))
+ return advstd::ranges::contains(*questObjectiveList, questObjectiveId, &QuestObjective::ID);
+
return false;
}