Merge branch '4.3.4_phases' of https://github.com/TrinityCore/TrinityCore into 4.3.4

This commit is contained in:
Kinzcool committed 2014-06-18 23:25:57 -04:00
commit 34572492dd
63 files changed
+623 -1039

No files matched your search

@@ -180,8 +180,6 @@ bool GameObject::Create(uint32 guidlow, uint32 name_id, Map* map, uint32 phaseMa
return false;
}
SetPhaseMask(phaseMask, false);
SetZoneScript();
if (m_zoneScript)
{
@@ -832,6 +830,16 @@ bool GameObject::LoadGameObjectFromDB(uint32 guid, Map* map, bool addToMap)
if (!Create(guid, entry, map, phaseMask, x, y, z, ang, rotation0, rotation1, rotation2, rotation3, animprogress, go_state, artKit))
return false;
if (data->phaseid)
SetInPhase(data->phaseid, false, true);
if (data->phaseGroup)
{
// Set the gameobject in all the phases of the phasegroup
for (auto ph : GetPhasesForGroup(data->phaseGroup))
SetInPhase(ph, false, true);
}
if (data->spawntimesecs >= 0)
{
m_spawnedByDefault = true;
@@ -2071,9 +2079,9 @@ void GameObject::SetDisplayId(uint32 displayid)
UpdateModel();
}
void GameObject::SetPhaseMask(uint32 newPhaseMask, bool update)
void GameObject::SetInPhase(uint32 id, bool update, bool apply)
{
WorldObject::SetPhaseMask(newPhaseMask, update);
WorldObject::SetInPhase(id, update, apply);
if (m_model && m_model->isEnabled())
EnableCollision(true);
}