Core/Spells: Fix custom load screen for SPELL_EFFECT_TELEPORT_UNITS

Port From (https://github.com/TrinityCore/TrinityCore/commit/29202810705804c1c5ac126195ab7bd60f56849f)
This commit is contained in:
Hondacrx
2024-11-17 14:07:41 -05:00
parent f2e8784960
commit d46636fc3a
4 changed files with 18 additions and 8 deletions
+3 -2
View File
@@ -621,11 +621,12 @@ namespace Game.Spells
// Custom loading screen
uint customLoadingScreenId = (uint)effectInfo.MiscValue;
if (customLoadingScreenId != 0)
player.SendPacket(new CustomLoadScreen(m_spellInfo.Id, customLoadingScreenId));
if (targetDest.GetMapId() != unitTarget.GetMapId() || !unitTarget.IsInDist2d(targetDest, PlayerConst.TeleportMinLoadScreenDistance))
player.SendPacket(new CustomLoadScreen(m_spellInfo.Id, customLoadingScreenId));
TeleportToOptions options = GetTeleportOptions(m_caster, unitTarget, m_destTargets[effectInfo.EffectIndex]);
player.TeleportTo(targetDest, options);
player.TeleportTo(targetDest, options, null, m_spellInfo.Id);
}
else if (targetDest.GetMapId() == unitTarget.GetMapId())
unitTarget.NearTeleportTo(targetDest, unitTarget == m_caster);