mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Core/Objects: Implement SmoothPhasing part of CreateObject and replacing visible objects
This commit is contained in:
@@ -670,6 +670,20 @@ bool PhasingHandler::IsPersonalPhase(uint32 phaseId)
|
||||
return false;
|
||||
}
|
||||
|
||||
void PhasingHandler::ReplaceObject(WorldObject* object, WorldObject* newObject, ObjectGuid const& replacedObjectGuid, bool stopAnimKits /*= true*/)
|
||||
{
|
||||
WorldObject* replacedObject = ObjectAccessor::GetWorldObject(*object, replacedObjectGuid);
|
||||
if (!replacedObject)
|
||||
return;
|
||||
|
||||
replacedObject->ReplaceWith(object, newObject, stopAnimKits);
|
||||
if (Player* player = object->ToPlayer())
|
||||
{
|
||||
WorldObject* targets[] = { newObject, replacedObject };
|
||||
player->UpdateVisibilityOf({ std::begin(targets), std::end(targets) });
|
||||
}
|
||||
}
|
||||
|
||||
void PhasingHandler::UpdateVisibilityIfNeeded(WorldObject* object, bool updateVisibility, bool changed)
|
||||
{
|
||||
if (changed && object->IsInWorld())
|
||||
|
||||
Reference in New Issue
Block a user