Skip to content

Commit ed41672

Browse files
mdX7Shauren
authored andcommitted
Core/Entities: Update StringId assignment to use StringIdType
(cherry picked from commit 9959a1373a1851e484ddef9268d98b116c5d8241)
1 parent d900e0e commit ed41672

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/server/game/Entities/Creature/Creature.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ bool Creature::UpdateEntry(uint32 entry, CreatureData const* data /*= nullptr*/,
635635
//We must update last scriptId or it looks like we reloaded a script, breaking some things such as gossip temporarily
636636
LastUsedScriptID = GetScriptId();
637637

638-
m_stringIds[0] = cInfo->StringId;
638+
m_stringIds[AsUnderlyingType(StringIdType::Template)] = cInfo->StringId;
639639

640640
return true;
641641
}
@@ -1687,7 +1687,7 @@ bool Creature::LoadFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap,
16871687
// checked at creature_template loading
16881688
m_defaultMovementType = MovementGeneratorType(data->movementType);
16891689

1690-
m_stringIds[1] = data->StringId;
1690+
m_stringIds[AsUnderlyingType(StringIdType::Spawn)] = data->StringId;
16911691

16921692
if (addToMap && !GetMap()->AddToMap(this))
16931693
return false;
@@ -2786,12 +2786,12 @@ void Creature::SetScriptStringId(std::string id)
27862786
if (!id.empty())
27872787
{
27882788
m_scriptStringId.emplace(std::move(id));
2789-
m_stringIds[2] = *m_scriptStringId;
2789+
m_stringIds[AsUnderlyingType(StringIdType::Script)] = *m_scriptStringId;
27902790
}
27912791
else
27922792
{
27932793
m_scriptStringId.reset();
2794-
m_stringIds[2] = {};
2794+
m_stringIds[AsUnderlyingType(StringIdType::Script)] = {};
27952795
}
27962796
}
27972797

src/server/game/Entities/GameObject/GameObject.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -418,7 +418,7 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
418418

419419
LastUsedScriptID = GetGOInfo()->ScriptId;
420420

421-
m_stringIds[0] = goinfo->StringId;
421+
m_stringIds[AsUnderlyingType(StringIdType::Template)] = goinfo->StringId;
422422

423423
AIM_Initialize();
424424

@@ -1145,7 +1145,7 @@ bool GameObject::LoadFromDB(ObjectGuid::LowType spawnId, Map* map, bool addToMap
11451145

11461146
m_goData = data;
11471147

1148-
m_stringIds[1] = data->StringId;
1148+
m_stringIds[AsUnderlyingType(StringIdType::Spawn)] = data->StringId;
11491149

11501150
if (addToMap && !GetMap()->AddToMap(this))
11511151
return false;
@@ -2285,12 +2285,12 @@ void GameObject::SetScriptStringId(std::string id)
22852285
if (!id.empty())
22862286
{
22872287
m_scriptStringId.emplace(std::move(id));
2288-
m_stringIds[2] = *m_scriptStringId;
2288+
m_stringIds[AsUnderlyingType(StringIdType::Script)] = *m_scriptStringId;
22892289
}
22902290
else
22912291
{
22922292
m_scriptStringId.reset();
2293-
m_stringIds[2] = {};
2293+
m_stringIds[AsUnderlyingType(StringIdType::Script)] = {};
22942294
}
22952295
}
22962296

0 commit comments

Comments
 (0)