aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/MapInstanced.cpp
diff options
context:
space:
mode:
authorRat <gmstreetrat@gmail.com>2011-11-23 20:23:04 +0100
committerRat <gmstreetrat@gmail.com>2011-11-23 20:23:04 +0100
commit47d0a7f3afbb25d26dec8721801b13d4392aaf1d (patch)
tree86b1d2c876d67fd855ac67d875210df4cdb95b43 /src/server/game/Maps/MapInstanced.cpp
parent47e28a7576d089552bc3ebf3dddcb6d9bf3e69f6 (diff)
parent0eb193f2b416af7f34bd89641aec88d843c9197e (diff)
Merge branch 'master' of github.com:TrinityCore/TrinityCore
Conflicts: src/server/game/DataStores/DBCStores.cpp src/server/game/DataStores/DBCfmt.h src/server/game/Server/Protocol/Opcodes.cpp
Diffstat (limited to 'src/server/game/Maps/MapInstanced.cpp')
-rwxr-xr-xsrc/server/game/Maps/MapInstanced.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp
index bbade4c9dc3..a56a193ba64 100755
--- a/src/server/game/Maps/MapInstanced.cpp
+++ b/src/server/game/Maps/MapInstanced.cpp
@@ -110,7 +110,7 @@ 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::CreateInstanceForPlayer(const uint32 mapId, Player* player)
{
if (GetId() != mapId || !player)
return NULL;
@@ -124,7 +124,7 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player* player)
// the instance id is set in battlegroundid
NewInstanceId = player->GetBattlegroundId();
if (!NewInstanceId) return NULL;
- map = _FindMap(NewInstanceId);
+ map = FindInstanceMap(NewInstanceId);
if (!map)
map = CreateBattleground(NewInstanceId, player->GetBattleground());
}
@@ -151,7 +151,7 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player* player)
{
// solo/perm/group
NewInstanceId = pSave->GetInstanceId();
- map = _FindMap(NewInstanceId);
+ map = FindInstanceMap(NewInstanceId);
// it is possible that the save exists but the map doesn't
if (!map)
map = CreateInstance(NewInstanceId, pSave, pSave->GetDifficulty());
@@ -163,7 +163,11 @@ Map* MapInstanced::CreateInstance(const uint32 mapId, Player* player)
NewInstanceId = sMapMgr->GenerateInstanceId();
Difficulty diff = player->GetGroup() ? player->GetGroup()->GetDifficulty(IsRaid()) : player->GetDifficulty(IsRaid());
- map = CreateInstance(NewInstanceId, NULL, diff);
+ //Seems it is now possible, but I do not know if it should be allowed
+ //ASSERT(!FindInstanceMap(NewInstanceId));
+ map = FindInstanceMap(NewInstanceId);
+ if (!map)
+ map = CreateInstance(NewInstanceId, NULL, diff);
}
}