Core/GameObjects: Set GO_FLAG_MAP_OBJECT for gameobjects that use a WMO model
authorShauren <shauren.trinity@gmail.com>
Tue, 10 Apr 2018 21:49:19 +0000 (23:49 +0200)
committerShauren <shauren.trinity@gmail.com>
Tue, 10 Apr 2018 21:49:19 +0000 (23:49 +0200)
src/server/game/Entities/GameObject/GameObject.cpp

index 23724c04aebb539ac3363c25d2970e38aa989e1b..09dcddf1649e300541ef456c2bc63ef70bf8ed17 100644 (file)
@@ -284,6 +284,8 @@ bool GameObject::Create(uint32 entry, Map* map, Position const& pos, QuaternionD
     SetDisplayId(goInfo->displayId);
 
     m_model = CreateModel();
+    if (m_model && m_model->isMapObject())
+        SetFlag(GAMEOBJECT_FLAGS, GO_FLAG_MAP_OBJECT);
     // GAMEOBJECT_BYTES_1, index at 0, 1, 2 and 3
     SetGoType(GameobjectTypes(goInfo->type));
     m_prevGoState = goState;
@@ -2406,6 +2408,8 @@ void GameObject::UpdateModel()
     m_model = CreateModel();
     if (m_model)
         GetMap()->InsertGameObjectModel(*m_model);
+
+    ApplyModFlag(GAMEOBJECT_FLAGS, GO_FLAG_MAP_OBJECT, m_model && m_model->isMapObject());
 }
 
 Player* GameObject::GetLootRecipient() const