aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-05-17 09:28:38 -0500
committermegamage <none@none>2009-05-17 09:28:38 -0500
commitf4efa0f1df25aab4ed233c7fd3d536ef46d483ed (patch)
treef84d3790aa4dfac1782b1e8ef84f13fd9ec33b96 /src
parent698b43f088b0c51dc9921d46ff915dae2d793503 (diff)
*Fix a crash caused by bg and arena.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/MapInstanced.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/game/MapInstanced.cpp b/src/game/MapInstanced.cpp
index 0ac64b8f62e..df0fca8016c 100644
--- a/src/game/MapInstanced.cpp
+++ b/src/game/MapInstanced.cpp
@@ -121,21 +121,25 @@ Map* MapInstanced::GetInstance(const WorldObject* obj)
Player* player = (Player*)obj;
uint32 instanceId = player->GetInstanceId();
+ if(instanceId)
+ if(Map *map = _FindMap(instanceId))
+ return map;
+
if(IsBattleGroundOrArena())
{
- if(!instanceId)
- instanceId = player->GetBattleGroundId();
+ instanceId = player->GetBattleGroundId();
if(instanceId)
- return _FindMap(instanceId);
+ {
+ if(Map *map = _FindMap(instanceId))
+ return map;
+ else
+ return CreateBattleGround(instanceId);
+ }
else
return NULL;
}
- if(instanceId)
- if(Map *map = _FindMap(instanceId))
- return map;
-
InstancePlayerBind *pBind = player->GetBoundInstance(GetId(), player->GetDifficulty());
InstanceSave *pSave = pBind ? pBind->save : NULL;
if(!pBind || !pBind->perm)