[9157] Prevent crash after .goname/namego teleports at same bg/arena.

Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
mns 2010-01-12 07:36:12 +03:00 committed by VladimirMangos
parent 07d121b6f7
commit dd6a6fcd58
2 changed files with 5 additions and 3 deletions

View file

@ -393,7 +393,8 @@ bool ChatHandler::HandleNamegoCommand(const char* args)
// when porting out from the bg, it will be reset to 0
target->SetBattleGroundId(m_session->GetPlayer()->GetBattleGroundId(), m_session->GetPlayer()->GetBattleGroundTypeId());
// remember current position as entry point for return at bg end teleportation
target->SetBattleGroundEntryPoint();
if (!target->GetMap()->IsBattleGroundOrArena())
target->SetBattleGroundEntryPoint();
}
else if (pMap->IsDungeon())
{
@ -507,7 +508,8 @@ bool ChatHandler::HandleGonameCommand(const char* args)
// when porting out from the bg, it will be reset to 0
_player->SetBattleGroundId(target->GetBattleGroundId(), target->GetBattleGroundTypeId());
// remember current position as entry point for return at bg end teleportation
_player->SetBattleGroundEntryPoint();
if (!_player->GetMap()->IsBattleGroundOrArena())
_player->SetBattleGroundEntryPoint();
}
else if(cMap->IsDungeon())
{