aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Spells/SpellEffects.cpp
diff options
context:
space:
mode:
authorKrudor <erikstrandberg93@hotmail.com>2017-03-17 18:50:11 +0100
committerShauren <shauren.trinity@gmail.com>2017-03-17 18:50:11 +0100
commit3df4135173cb8b8393460403417dc242116290bf (patch)
tree9d98eef6d4607e0ce16f73c5cf310f3c60592792 /src/server/game/Spells/SpellEffects.cpp
parent8a64f066a04483be9c14e9c15d1a4d764beac9c9 (diff)
Core/Spell: Implement and use SMSG_CUSTOM_LOAD_SCREEN (#19310)
Diffstat (limited to 'src/server/game/Spells/SpellEffects.cpp')
-rw-r--r--src/server/game/Spells/SpellEffects.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/server/game/Spells/SpellEffects.cpp b/src/server/game/Spells/SpellEffects.cpp
index b252dc0b731..e29f4c5eea1 100644
--- a/src/server/game/Spells/SpellEffects.cpp
+++ b/src/server/game/Spells/SpellEffects.cpp
@@ -929,8 +929,14 @@ void Spell::EffectTeleportUnits(SpellEffIndex /*effIndex*/)
orientation = m_targets.GetUnitTarget()->GetOrientation();
TC_LOG_DEBUG("spells", "Spell::EffectTeleportUnits - teleport unit to %u %f %f %f %f\n", mapid, x, y, z, orientation);
- if (unitTarget->GetTypeId() == TYPEID_PLAYER)
- unitTarget->ToPlayer()->TeleportTo(mapid, x, y, z, orientation, unitTarget == m_caster ? TELE_TO_SPELL | TELE_TO_NOT_LEAVE_COMBAT : 0);
+ if (Player* player = unitTarget->ToPlayer())
+ {
+ // Custom loading screen
+ if (uint32 customLoadingScreenId = effectInfo->MiscValue)
+ player->SendDirectMessage(WorldPackets::Spells::CustomLoadScreen(m_spellInfo->Id, customLoadingScreenId).Write());
+
+ player->TeleportTo(mapid, x, y, z, orientation, unitTarget == m_caster ? TELE_TO_SPELL | TELE_TO_NOT_LEAVE_COMBAT : 0);
+ }
else if (mapid == unitTarget->GetMapId())
unitTarget->NearTeleportTo(x, y, z, orientation, unitTarget == m_caster);
else