mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-19 17:05:44 +01:00
*Fix a crash caused by bg and arena.
--HG-- branch : trunk
This commit is contained in:
@@ -121,21 +121,25 @@ Map* MapInstanced::GetInstance(const WorldObject* obj)
|
||||
Player* player = (Player*)obj;
|
||||
uint32 instanceId = player->GetInstanceId();
|
||||
|
||||
if(IsBattleGroundOrArena())
|
||||
{
|
||||
if(!instanceId)
|
||||
instanceId = player->GetBattleGroundId();
|
||||
|
||||
if(instanceId)
|
||||
return _FindMap(instanceId);
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
if(instanceId)
|
||||
if(Map *map = _FindMap(instanceId))
|
||||
return map;
|
||||
|
||||
if(IsBattleGroundOrArena())
|
||||
{
|
||||
instanceId = player->GetBattleGroundId();
|
||||
|
||||
if(instanceId)
|
||||
{
|
||||
if(Map *map = _FindMap(instanceId))
|
||||
return map;
|
||||
else
|
||||
return CreateBattleGround(instanceId);
|
||||
}
|
||||
else
|
||||
return NULL;
|
||||
}
|
||||
|
||||
InstancePlayerBind *pBind = player->GetBoundInstance(GetId(), player->GetDifficulty());
|
||||
InstanceSave *pSave = pBind ? pBind->save : NULL;
|
||||
if(!pBind || !pBind->perm)
|
||||
|
||||
Reference in New Issue
Block a user