fix (core) Script Names not loaded with manual add (#11102)
This fixes Script names not being loaded with npcs and gameobjects when manually added with the .npc\gameobject add cmd that would lead the user to restart the server to load up the npc\gameobject with the script that was manually added
This commit is contained in:
parent
9f4f824336
commit
77f13636b7
2 changed files with 4 additions and 2 deletions
|
|
@ -2837,7 +2837,8 @@ std::string Creature::GetScriptName() const
|
|||
uint32 Creature::GetScriptId() const
|
||||
{
|
||||
if (CreatureData const* creatureData = GetCreatureData())
|
||||
return creatureData->ScriptId;
|
||||
if (uint32 scriptId = creatureData->ScriptId)
|
||||
return scriptId;
|
||||
|
||||
return sObjectMgr->GetCreatureTemplate(GetEntry())->ScriptID;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -2141,7 +2141,8 @@ void GameObject::EventInform(uint32 eventId)
|
|||
uint32 GameObject::GetScriptId() const
|
||||
{
|
||||
if (GameObjectData const* gameObjectData = GetGOData())
|
||||
return gameObjectData->ScriptId;
|
||||
if (uint32 scriptId = gameObjectData->ScriptId)
|
||||
return scriptId;
|
||||
|
||||
return GetGOInfo()->ScriptId;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue