Core/Entities: add extra use of UPDATETYPE_CREATE_OBJECT2 (#20955)

(cherry picked from commit 51c4196acf)
This commit is contained in:
Gustavo
2017-12-15 22:11:02 -02:00
committed by funjoker
parent f60b0ead83
commit 044110d423
3 changed files with 5 additions and 0 deletions

View File

@@ -67,6 +67,7 @@ Object::Object() : m_values(this)
m_updateFlag.Clear();
m_inWorld = false;
m_isNewObject = false;
m_objectUpdated = false;
}

View File

@@ -168,6 +168,7 @@ class TC_GAME_API Object
virtual bool hasQuest(uint32 /* quest_id */) const { return false; }
virtual bool hasInvolvedQuest(uint32 /* quest_id */) const { return false; }
void SetIsNewObject(bool enable) { m_isNewObject = enable; }
virtual void BuildUpdate(UpdateDataMapType&) { }
void BuildFieldsUpdate(Player*, UpdateDataMapType &) const;
@@ -346,6 +347,7 @@ class TC_GAME_API Object
private:
ObjectGuid m_guid;
bool m_inWorld;
bool m_isNewObject;
Object(Object const& right) = delete;
Object& operator=(Object const& right) = delete;

View File

@@ -728,7 +728,9 @@ bool Map::AddToMap(T* obj)
//something, such as vehicle, needs to be update immediately
//also, trigger needs to cast spell, if not update, cannot see visual
obj->SetIsNewObject(true);
obj->UpdateObjectVisibilityOnCreate();
obj->SetIsNewObject(false);
return true;
}