mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-23 10:26:28 +01:00
Core/Entities: Update StringId assignment to use StringIdType
(cherry picked from commit 9959a1373a)
This commit is contained in:
@@ -635,7 +635,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;
|
||||
}
|
||||
@@ -1687,7 +1687,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;
|
||||
@@ -2786,12 +2786,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)] = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -418,7 +418,7 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
|
||||
|
||||
LastUsedScriptID = GetGOInfo()->ScriptId;
|
||||
|
||||
m_stringIds[0] = goinfo->StringId;
|
||||
m_stringIds[AsUnderlyingType(StringIdType::Template)] = goinfo->StringId;
|
||||
|
||||
AIM_Initialize();
|
||||
|
||||
@@ -1145,7 +1145,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;
|
||||
@@ -2285,12 +2285,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)] = {};
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user