Core/Objects: Implement SmoothPhasing part of CreateObject and replacing visible objects
Port From (https://github.com/TrinityCore/TrinityCore/commit/a5c713eaf21ce086074cf5934d1ee105c2c86922)
This commit is contained in:
@@ -663,6 +663,19 @@ namespace Game
|
||||
return false;
|
||||
}
|
||||
|
||||
public static void ReplaceObject(WorldObject obj, WorldObject newObject, ObjectGuid replacedObjectGuid, bool stopAnimKits = true)
|
||||
{
|
||||
WorldObject replacedObject = Global.ObjAccessor.GetWorldObject(obj, replacedObjectGuid);
|
||||
if (replacedObject == null)
|
||||
return;
|
||||
|
||||
replacedObject.ReplaceWith(obj, newObject, stopAnimKits);
|
||||
|
||||
Player player = obj.ToPlayer();
|
||||
if (player != null)
|
||||
player.UpdateVisibilityOf(new[] { newObject, replacedObject });
|
||||
}
|
||||
|
||||
static void UpdateVisibilityIfNeeded(WorldObject obj, bool updateVisibility, bool changed)
|
||||
{
|
||||
if (changed && obj.IsInWorld)
|
||||
|
||||
Reference in New Issue
Block a user