mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-17 13:39:46 -04:00
Core/Entities: Added possibility to inherit StringIds from other entities (#29908)
* also implicitly do so for personal summons
This commit is contained in:
@@ -3497,6 +3497,15 @@ uint32 GameObject::GetScriptId() const
|
||||
return GetGOInfo()->ScriptId;
|
||||
}
|
||||
|
||||
void GameObject::InheritStringIds(GameObject const* parent)
|
||||
{
|
||||
// copy references to stringIds from template and spawn
|
||||
m_stringIds = parent->m_stringIds;
|
||||
|
||||
// then copy script stringId, not just its reference
|
||||
SetScriptStringId(std::string(parent->GetStringId(StringIdType::Script)));
|
||||
}
|
||||
|
||||
bool GameObject::HasStringId(std::string_view id) const
|
||||
{
|
||||
return std::find(m_stringIds.begin(), m_stringIds.end(), id) != m_stringIds.end();
|
||||
|
||||
Reference in New Issue
Block a user