Core/Objects: Cleanup SmoothPhasing code - move to separate files and better integrate it with visibility system

Port From (https://github.com/TrinityCore/TrinityCore/commit/70442041300bb0a1146717497fd5f771d874befa)
This commit is contained in:
hondacrx
2022-03-09 14:51:55 -05:00
parent f0d1a632ff
commit ffd0f4280b
9 changed files with 219 additions and 137 deletions
-13
View File
@@ -662,19 +662,6 @@ 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)
{