diff options
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.h')
-rw-r--r-- | src/server/game/Globals/ObjectMgr.h | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index db973b2fd56..0002cea5292 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -510,7 +510,7 @@ typedef std::unordered_map<ObjectGuid::LowType, GameObjectData> GameObjectDataCo typedef std::unordered_map<ObjectGuid::LowType, GameObjectAddon> GameObjectAddonContainer; typedef std::unordered_map<uint32, std::vector<uint32>> GameObjectQuestItemMap; typedef std::unordered_map<uint32, SpawnGroupTemplateData> SpawnGroupDataContainer; -typedef std::multimap<uint32, SpawnData const*> SpawnGroupLinkContainer; +typedef std::multimap<uint32, SpawnMetadata const*> SpawnGroupLinkContainer; typedef std::unordered_map<uint16, std::vector<InstanceSpawnGroupInfo>> InstanceSpawnGroupContainer; typedef std::map<TempSummonGroupKey, std::vector<TempSummonData>> TempSummonDataContainer; typedef std::unordered_map<uint32, CreatureLocale> CreatureLocaleContainer; @@ -1430,9 +1430,10 @@ class TC_GAME_API ObjectMgr ObjectGuid::LowType GenerateGameObjectSpawnId(); SpawnGroupTemplateData const* GetSpawnGroupData(uint32 groupId) const { auto it = _spawnGroupDataStore.find(groupId); return it != _spawnGroupDataStore.end() ? &it->second : nullptr; } + SpawnGroupTemplateData const* GetSpawnGroupData(SpawnObjectType type, ObjectGuid::LowType spawnId) const { SpawnMetadata const* data = GetSpawnMetadata(type, spawnId); return data ? data->spawnGroupData : nullptr; } SpawnGroupTemplateData const* GetDefaultSpawnGroup() const { return &_spawnGroupDataStore.at(0); } SpawnGroupTemplateData const* GetLegacySpawnGroup() const { return &_spawnGroupDataStore.at(1); } - Trinity::IteratorPair<SpawnGroupLinkContainer::const_iterator> GetSpawnDataForGroup(uint32 groupId) const { return Trinity::Containers::MapEqualRange(_spawnGroupMapStore, groupId); } + Trinity::IteratorPair<SpawnGroupLinkContainer::const_iterator> GetSpawnMetadataForGroup(uint32 groupId) const { return Trinity::Containers::MapEqualRange(_spawnGroupMapStore, groupId); } std::vector<InstanceSpawnGroupInfo> const* GetSpawnGroupsForInstance(uint32 instanceId) const { auto it = _instanceSpawnGroupStore.find(instanceId); return it != _instanceSpawnGroupStore.end() ? &it->second : nullptr; } MailLevelReward const* GetMailLevelReward(uint8 level, uint8 race) const @@ -1476,29 +1477,28 @@ class TC_GAME_API ObjectMgr return nullptr; } - SpawnData const* GetSpawnData(SpawnObjectType type, ObjectGuid::LowType guid) + SpawnMetadata const* GetSpawnMetadata(SpawnObjectType type, ObjectGuid::LowType spawnId) const { - if (type == SPAWN_TYPE_CREATURE) - return GetCreatureData(guid); - else if (type == SPAWN_TYPE_GAMEOBJECT) - return GetGameObjectData(guid); + if (SpawnData::TypeHasData(type)) + return GetSpawnData(type, spawnId); else - ASSERT(false, "Invalid spawn object type %u", uint32(type)); - return nullptr; + return nullptr; } + + SpawnData const* GetSpawnData(SpawnObjectType type, ObjectGuid::LowType spawnId) const; void OnDeleteSpawnData(SpawnData const* data); CreatureDataContainer const& GetAllCreatureData() const { return _creatureDataStore; } - CreatureData const* GetCreatureData(ObjectGuid::LowType guid) const + CreatureData const* GetCreatureData(ObjectGuid::LowType spawnId) const { - CreatureDataContainer::const_iterator itr = _creatureDataStore.find(guid); + CreatureDataContainer::const_iterator itr = _creatureDataStore.find(spawnId); if (itr == _creatureDataStore.end()) return nullptr; return &itr->second; } - CreatureData& NewOrExistCreatureData(ObjectGuid::LowType guid) { return _creatureDataStore[guid]; } - void DeleteCreatureData(ObjectGuid::LowType guid); - ObjectGuid GetLinkedRespawnGuid(ObjectGuid guid) const + CreatureData& NewOrExistCreatureData(ObjectGuid::LowType spawnId) { return _creatureDataStore[spawnId]; } + void DeleteCreatureData(ObjectGuid::LowType spawnId); + ObjectGuid GetLinkedRespawnGuid(ObjectGuid spawnId) const { - LinkedRespawnContainer::const_iterator itr = _linkedRespawnStore.find(guid); + LinkedRespawnContainer::const_iterator itr = _linkedRespawnStore.find(spawnId); if (itr == _linkedRespawnStore.end()) return ObjectGuid::Empty; return itr->second; } @@ -1509,14 +1509,14 @@ class TC_GAME_API ObjectMgr return &itr->second; } GameObjectDataContainer const& GetAllGameObjectData() const { return _gameObjectDataStore; } - GameObjectData const* GetGameObjectData(ObjectGuid::LowType guid) const + GameObjectData const* GetGameObjectData(ObjectGuid::LowType spawnId) const { - GameObjectDataContainer::const_iterator itr = _gameObjectDataStore.find(guid); + GameObjectDataContainer::const_iterator itr = _gameObjectDataStore.find(spawnId); if (itr == _gameObjectDataStore.end()) return nullptr; return &itr->second; } - GameObjectData& NewOrExistGameObjectData(ObjectGuid::LowType guid) { return _gameObjectDataStore[guid]; } - void DeleteGameObjectData(ObjectGuid::LowType guid); + GameObjectData& NewOrExistGameObjectData(ObjectGuid::LowType spawnId) { return _gameObjectDataStore[spawnId]; } + void DeleteGameObjectData(ObjectGuid::LowType spawnId); GameObjectLocale const* GetGameObjectLocale(uint32 entry) const { GameObjectLocaleContainer::const_iterator itr = _gameObjectLocaleStore.find(entry); |