aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/MapInstanced.cpp
diff options
context:
space:
mode:
authorkvipka <qvipka@gmail.com>2020-08-28 20:48:41 +0300
committerGitHub <noreply@github.com>2020-08-28 19:48:41 +0200
commit5d2780c43c36b0ae1cc4ac2694bf6ec464d079c7 (patch)
treeaa5e5e3c597099145bbf6a01f89e583217cb297f /src/server/game/Maps/MapInstanced.cpp
parentb63f5b0d83174abfb1b74111514ec424f5efe748 (diff)
Scripts/InstanceScript: Fix an issue where LoadAllGrids would load creatures before TeamInInstance was properly set (PR #25340)
Diffstat (limited to 'src/server/game/Maps/MapInstanced.cpp')
-rw-r--r--src/server/game/Maps/MapInstanced.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp
index ae023f153bb..2d7feeda28d 100644
--- a/src/server/game/Maps/MapInstanced.cpp
+++ b/src/server/game/Maps/MapInstanced.cpp
@@ -155,7 +155,7 @@ Map* MapInstanced::CreateInstanceForPlayer(uint32 mapId, Player* player, uint32
{
map = FindInstanceMap(loginInstanceId);
if (!map && pSave && pSave->GetInstanceId() == loginInstanceId)
- map = CreateInstance(loginInstanceId, pSave, pSave->GetDifficulty());
+ map = CreateInstance(loginInstanceId, pSave, pSave->GetDifficulty(), player->GetTeamId());
return map;
}
@@ -180,7 +180,7 @@ Map* MapInstanced::CreateInstanceForPlayer(uint32 mapId, Player* player, uint32
map = FindInstanceMap(newInstanceId);
// it is possible that the save exists but the map doesn't
if (!map)
- map = CreateInstance(newInstanceId, pSave, pSave->GetDifficulty());
+ map = CreateInstance(newInstanceId, pSave, pSave->GetDifficulty(), player->GetTeamId());
}
else
{
@@ -193,14 +193,14 @@ Map* MapInstanced::CreateInstanceForPlayer(uint32 mapId, Player* player, uint32
//ASSERT(!FindInstanceMap(NewInstanceId));
map = FindInstanceMap(newInstanceId);
if (!map)
- map = CreateInstance(newInstanceId, nullptr, diff);
+ map = CreateInstance(newInstanceId, nullptr, diff, player->GetTeamId());
}
}
return map;
}
-InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save, Difficulty difficulty)
+InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save, Difficulty difficulty, TeamId InstanceTeam)
{
// load/create a map
std::lock_guard<std::mutex> lock(_mapLock);
@@ -224,7 +224,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save,
TC_LOG_DEBUG("maps", "MapInstanced::CreateInstance: %s map instance %d for %d created with difficulty %s", save?"":"new ", InstanceId, GetId(), difficulty?"heroic":"normal");
- InstanceMap* map = new InstanceMap(GetId(), GetGridExpiry(), InstanceId, difficulty, this);
+ InstanceMap* map = new InstanceMap(GetId(), GetGridExpiry(), InstanceId, difficulty, this, InstanceTeam);
ASSERT(map->IsDungeon());
map->LoadRespawnTimes();