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:
acidmanifesto
2022-03-22 09:49:06 -04:00
committed by GitHub
parent 9f4f824336
commit 77f13636b7
2 changed files with 4 additions and 2 deletions

View File

@@ -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;
}