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:
@@ -2837,7 +2837,8 @@ std::string Creature::GetScriptName() const
|
|||||||
uint32 Creature::GetScriptId() const
|
uint32 Creature::GetScriptId() const
|
||||||
{
|
{
|
||||||
if (CreatureData const* creatureData = GetCreatureData())
|
if (CreatureData const* creatureData = GetCreatureData())
|
||||||
return creatureData->ScriptId;
|
if (uint32 scriptId = creatureData->ScriptId)
|
||||||
|
return scriptId;
|
||||||
|
|
||||||
return sObjectMgr->GetCreatureTemplate(GetEntry())->ScriptID;
|
return sObjectMgr->GetCreatureTemplate(GetEntry())->ScriptID;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2141,7 +2141,8 @@ void GameObject::EventInform(uint32 eventId)
|
|||||||
uint32 GameObject::GetScriptId() const
|
uint32 GameObject::GetScriptId() const
|
||||||
{
|
{
|
||||||
if (GameObjectData const* gameObjectData = GetGOData())
|
if (GameObjectData const* gameObjectData = GetGOData())
|
||||||
return gameObjectData->ScriptId;
|
if (uint32 scriptId = gameObjectData->ScriptId)
|
||||||
|
return scriptId;
|
||||||
|
|
||||||
return GetGOInfo()->ScriptId;
|
return GetGOInfo()->ScriptId;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user