*Improvements in map managing.

--HG--
branch : trunk
This commit is contained in:
QAston
2009-08-01 00:20:32 +02:00
parent 0db1fd6c26
commit 1d96091d2a
24 changed files with 276 additions and 305 deletions

View File

@@ -116,27 +116,16 @@ void MapInstanced::UnloadAll()
- create the instance if it's not created already
- the player is not actually added to the instance (only in InstanceMap::Add)
*/
Map* MapInstanced::CreateInstance(const uint32 mapId, Player * player)
Map* MapInstanced::CreateInstance(const uint32 mapId, Player * player, uint32 instanceId)
{
uint32 instanceId = player->GetInstanceId();
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;
assert(player->GetBattleGroundId());
return CreateBattleGround(player->GetBattleGroundId());
}
if(InstanceSave *pSave = player->GetInstanceSave(GetId()))