CORE/Movement: Fix a potential crash with a player out of bounds. (#970)

This commit is contained in:
Barbz
2018-12-26 01:42:27 +01:00
committed by Nefertumm
parent db25b814e2
commit d167890b3f

View File

@@ -488,10 +488,12 @@ void WorldSession::HandleMovementOpcodes(WorldPacket & recvData)
else if (!plrMover->HasFlag(PLAYER_FLAGS, PLAYER_FLAGS_IS_OUT_OF_BOUNDS))
{
WorldSafeLocsEntry const* grave = sObjectMgr->GetClosestGraveyard(plrMover->GetPositionX(), plrMover->GetPositionY(), plrMover->GetPositionZ(), plrMover->GetMapId(), plrMover->GetTeamId());
if ( grave)
if (grave)
{
plrMover->TeleportTo(grave->map_id, grave->x, grave->y, grave->z, plrMover->GetOrientation());
plrMover->Relocate(grave->x, grave->y, grave->z, plrMover->GetOrientation());
plrMover->Relocate(grave->x, grave->y, grave->z, plrMover->GetOrientation());
}
}
plrMover->StopMovingOnCurrentPos(); // pussywizard: moving corpse can't release spirit