Core/GameObjects: Properly set GO_FLAG_MAP_OBJECT during gameobject creation
Port From (https://github.com/TrinityCore/TrinityCore/commit/e3cf94d4fdbfae5ce99aa754bd29a0b77cd1b73d)
This commit is contained in:
@@ -266,9 +266,7 @@ namespace Game.Entities
|
|||||||
|
|
||||||
SetDisplayId(goInfo.displayId);
|
SetDisplayId(goInfo.displayId);
|
||||||
|
|
||||||
m_model = CreateModel();
|
CreateModel();
|
||||||
if (m_model != null && m_model.IsMapObject())
|
|
||||||
AddFlag(GameObjectFlags.MapObject);
|
|
||||||
|
|
||||||
// GAMEOBJECT_BYTES_1, index at 0, 1, 2 and 3
|
// GAMEOBJECT_BYTES_1, index at 0, 1, 2 and 3
|
||||||
SetGoType(goInfo.type);
|
SetGoType(goInfo.type);
|
||||||
@@ -2410,14 +2408,12 @@ namespace Game.Entities
|
|||||||
if (GetMap().ContainsGameObjectModel(m_model))
|
if (GetMap().ContainsGameObjectModel(m_model))
|
||||||
GetMap().RemoveGameObjectModel(m_model);
|
GetMap().RemoveGameObjectModel(m_model);
|
||||||
|
|
||||||
m_model = CreateModel();
|
RemoveFlag(GameObjectFlags.MapObject);
|
||||||
|
m_model = null;
|
||||||
|
CreateModel();
|
||||||
|
|
||||||
if (m_model != null)
|
if (m_model != null)
|
||||||
GetMap().InsertGameObjectModel(m_model);
|
GetMap().InsertGameObjectModel(m_model);
|
||||||
|
|
||||||
if (m_model != null && m_model.IsMapObject())
|
|
||||||
AddFlag(GameObjectFlags.MapObject);
|
|
||||||
else
|
|
||||||
RemoveFlag(GameObjectFlags.MapObject);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
Player GetLootRecipient()
|
Player GetLootRecipient()
|
||||||
@@ -2763,9 +2759,11 @@ namespace Game.Entities
|
|||||||
return IsInRange(obj.GetPositionX(), obj.GetPositionY(), obj.GetPositionZ(), dist2compare);
|
return IsInRange(obj.GetPositionX(), obj.GetPositionY(), obj.GetPositionZ(), dist2compare);
|
||||||
}
|
}
|
||||||
|
|
||||||
public GameObjectModel CreateModel()
|
public void CreateModel()
|
||||||
{
|
{
|
||||||
return GameObjectModel.Create(new GameObjectModelOwnerImpl(this));
|
m_model = GameObjectModel.Create(new GameObjectModelOwnerImpl(this));
|
||||||
|
if (m_model != null && m_model.IsMapObject())
|
||||||
|
AddFlag(GameObjectFlags.MapObject);
|
||||||
}
|
}
|
||||||
|
|
||||||
#region Fields
|
#region Fields
|
||||||
|
|||||||
@@ -133,7 +133,7 @@ namespace Game.Entities
|
|||||||
SetWorldRotation(0.0f, 0.0f, 0.0f, 1.0f);
|
SetWorldRotation(0.0f, 0.0f, 0.0f, 1.0f);
|
||||||
SetParentRotation(Quaternion.WAxis);
|
SetParentRotation(Quaternion.WAxis);
|
||||||
|
|
||||||
m_model = CreateModel();
|
CreateModel();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user