fix(Core/GameObject): load guid based scripts correctly (#18811)
- m_goData must be assigned before Create() is beeing called - otherwise GetScriptId() can't load the correct scriptiD in Create() - all in all this is now more in line with how it's beeing done in Creature.cpp
This commit is contained in:
parent
1f5fe728c2
commit
0a376bdc76
1 changed files with 2 additions and 3 deletions
|
|
@ -406,7 +406,7 @@ bool GameObject::Create(ObjectGuid::LowType guidlow, uint32 name_id, Map* map, u
|
|||
}
|
||||
}
|
||||
|
||||
LastUsedScriptID = GetGOInfo()->ScriptId;
|
||||
LastUsedScriptID = GetScriptId();
|
||||
AIM_Initialize();
|
||||
|
||||
if (uint32 linkedEntry = GetGOInfo()->GetLinkedGameObjectEntry())
|
||||
|
|
@ -1140,6 +1140,7 @@ bool GameObject::LoadGameObjectFromDB(ObjectGuid::LowType spawnId, Map* map, boo
|
|||
GOState go_state = data->go_state;
|
||||
uint32 artKit = data->artKit;
|
||||
|
||||
m_goData = data;
|
||||
m_spawnId = spawnId;
|
||||
|
||||
if (!Create(map->GenerateLowGuid<HighGuid::GameObject>(), entry, map, phaseMask, x, y, z, ang, data->rotation, animprogress, go_state, artKit))
|
||||
|
|
@ -1175,8 +1176,6 @@ bool GameObject::LoadGameObjectFromDB(ObjectGuid::LowType spawnId, Map* map, boo
|
|||
m_respawnTime = 0;
|
||||
}
|
||||
|
||||
m_goData = data;
|
||||
|
||||
if (addToMap && !GetMap()->AddToMap(this))
|
||||
return false;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue