From 5878e2be5691342bd9342511de2807a691a7f025 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Wed, 17 Mar 2021 17:02:15 -0400 Subject: [PATCH] Core/Entities: add extra use of UPDATETYPE_CREATE_OBJECT2 Port From (https://github.com/TrinityCore/TrinityCore/commit/044110d42366c3e91007add3a2aa4bd02cbe7d2c) --- Source/Game/Entities/Object/WorldObject.cs | 2 ++ Source/Game/Maps/Map.cs | 2 ++ 2 files changed, 4 insertions(+) diff --git a/Source/Game/Entities/Object/WorldObject.cs b/Source/Game/Entities/Object/WorldObject.cs index 89eeeeb8f..d76b03705 100644 --- a/Source/Game/Entities/Object/WorldObject.cs +++ b/Source/Game/Entities/Object/WorldObject.cs @@ -1719,6 +1719,7 @@ namespace Game.Entities public virtual bool HasQuest(uint questId) { return false; } public virtual bool HasInvolvedQuest(uint questId) { return false; } + public void SetIsNewObject(bool enable) { _isNewObject = enable; } public bool IsCreature() { return GetTypeId() == TypeId.Unit; } public bool IsPlayer() { return GetTypeId() == TypeId.Player; } @@ -2352,6 +2353,7 @@ namespace Game.Entities protected TypeId ObjectTypeId { get; set; } protected CreateObjectBits m_updateFlag; ObjectGuid m_guid; + bool _isNewObject; public UpdateFieldHolder m_values; public ObjectFieldData m_objectData; diff --git a/Source/Game/Maps/Map.cs b/Source/Game/Maps/Map.cs index 903881b00..937bca0d1 100644 --- a/Source/Game/Maps/Map.cs +++ b/Source/Game/Maps/Map.cs @@ -611,7 +611,9 @@ namespace Game.Maps //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; }