mirror of
https://github.com/araxiaonline/TrinityCore.git
synced 2026-06-16 21:20:01 -04:00
Core/Phases: Preliminary work with correctly implementing the phase system in 4.3.4
Put here for peer review.
This commit is contained in:
@@ -813,6 +813,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;
|
||||
@@ -2053,6 +2063,13 @@ void GameObject::SetDisplayId(uint32 displayid)
|
||||
UpdateModel();
|
||||
}
|
||||
|
||||
void GameObject::SetInPhase(uint32 id, bool update, bool apply)
|
||||
{
|
||||
WorldObject::SetInPhase(id, update, apply);
|
||||
if (m_model && m_model->isEnabled())
|
||||
EnableCollision(true);
|
||||
}
|
||||
|
||||
void GameObject::SetPhaseMask(uint32 newPhaseMask, bool update)
|
||||
{
|
||||
WorldObject::SetPhaseMask(newPhaseMask, update);
|
||||
|
||||
Reference in New Issue
Block a user