Core/Players: Remove player from transport before teleporting to graveyard, will fix infinite recursion when trying to access unavailable map

Core/Auras: Removed unneeded typecasting

Closes issue #4862.

--HG--
branch : trunk
This commit is contained in:
Shauren
2010-12-19 00:01:22 +01:00
parent a8214a682a
commit 43377b4daf
2 changed files with 8 additions and 1 deletions
@@ -1845,7 +1845,14 @@ bool Player::TeleportTo(uint32 mapid, float x, float y, float z, float orientati
sLog.outDebug("Player %s using client without required expansion tried teleport to non accessible map %u", GetName(), mapid);
if (GetTransport())
{
m_transport->RemovePassenger(this);
m_transport = NULL;
m_movementInfo.t_pos.Relocate(0.0f, 0.0f, 0.0f, 0.0f);
m_movementInfo.t_time = 0;
m_movementInfo.t_seat = -1;
RepopAtGraveyard(); // teleport to near graveyard if on transport, looks blizz like :)
}
SendTransferAborted(mapid, TRANSFER_ABORT_INSUF_EXPAN_LVL, mEntry->Expansion());
@@ -1241,7 +1241,7 @@ void AuraEffect::SendTickImmune(Unit * target, Unit *caster) const
void AuraEffect::PeriodicTick(AuraApplication * aurApp, Unit * caster) const
{
bool prevented = GetBase()->CallScriptEffectPeriodicHandlers(const_cast<AuraEffect const *>(this), aurApp);
bool prevented = GetBase()->CallScriptEffectPeriodicHandlers(this, aurApp);
if (prevented)
return;