aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorModoX <moardox@gmail.com>2024-04-09 16:39:15 +0200
committerOvahlord <dreadkiller@gmx.de>2024-05-28 16:40:23 +0200
commitad5013ebf6e02afa8d506d41c5207e7b736af52a (patch)
treeb92424e2fa262d441576157d786bba4affa42d45
parent3db82077c9a7565e82089b2d6436031c2eceb17b (diff)
Core/Entities: Update StringId assignment to use StringIdType
(cherry picked from commit 9959a1373a1851e484ddef9268d98b116c5d8241)
-rw-r--r--src/server/game/Entities/Creature/Creature.cpp8
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp8
2 files changed, 8 insertions, 8 deletions
diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp
index 146b353059c..b0e92968e14 100644
--- a/src/server/game/Entities/Creature/Creature.cpp
+++ b/src/server/game/Entities/Creature/Creature.cpp
@@ -684,7 +684,7 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/,
//We must update last scriptId or it looks like we reloaded a script, breaking some things such as gossip temporarily
LastUsedScriptID = GetScriptId();
- m_stringIds[0] = cInfo->StringId;
+ m_stringIds[AsUnderlyingType(StringIdType::Template)] = cInfo->StringId;
return true;
}
@@ -1909,7 +1909,7 @@ bool Creature::LoadFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap,
// checked at creature_template loading
m_defaultMovementType = MovementGeneratorType(data->movementType);
- m_stringIds[1] = data->StringId;
+ m_stringIds[AsUnderlyingType(StringIdType::Spawn)] = data->StringId;
if (addToMap && !GetMap()->AddToMap(this))
return false;
@@ -3030,12 +3030,12 @@ void Creature::SetScriptStringId(std::string id)
if (!id.empty())
{
m_scriptStringId.emplace(std::move(id));
- m_stringIds[2] = *m_scriptStringId;
+ m_stringIds[AsUnderlyingType(StringIdType::Script)] = *m_scriptStringId;
}
else
{
m_scriptStringId.reset();
- m_stringIds[2] = {};
+ m_stringIds[AsUnderlyingType(StringIdType::Script)] = {};
}
}
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index a716b233621..cc0f76be458 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -1158,7 +1158,7 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
LastUsedScriptID = GetGOInfo()->ScriptId;
- m_stringIds[0] = goInfo->StringId;
+ m_stringIds[AsUnderlyingType(StringIdType::Template)] = goInfo->StringId;
AIM_Initialize();
@@ -1978,7 +1978,7 @@ bool GameObject::LoadFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap
m_goData = data;
- m_stringIds[1] = data->StringId;
+ m_stringIds[AsUnderlyingType(StringIdType::Spawn)] = data->StringId;
if (addToMap && !GetMap()->AddToMap(this))
return false;
@@ -3493,12 +3493,12 @@ void GameObject::SetScriptStringId(std::string id)
if (!id.empty())
{
m_scriptStringId.emplace(std::move(id));
- m_stringIds[2] = *m_scriptStringId;
+ m_stringIds[AsUnderlyingType(StringIdType::Script)] = *m_scriptStringId;
}
else
{
m_scriptStringId.reset();
- m_stringIds[2] = {};
+ m_stringIds[AsUnderlyingType(StringIdType::Script)] = {};
}
}