mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 23:50:44 +01:00
Core/Entities: add extra use of UPDATETYPE_CREATE_OBJECT2 (#20955)
(cherry picked from commit 51c4196acf)
This commit is contained in:
@@ -67,6 +67,7 @@ Object::Object() : m_values(this)
|
||||
m_updateFlag.Clear();
|
||||
|
||||
m_inWorld = false;
|
||||
m_isNewObject = false;
|
||||
m_objectUpdated = false;
|
||||
}
|
||||
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user