aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/MapInstanced.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Maps/MapInstanced.cpp')
-rw-r--r--src/server/game/Maps/MapInstanced.cpp28
1 files changed, 15 insertions, 13 deletions
diff --git a/src/server/game/Maps/MapInstanced.cpp b/src/server/game/Maps/MapInstanced.cpp
index d54e758e581..4b8863889a1 100644
--- a/src/server/game/Maps/MapInstanced.cpp
+++ b/src/server/game/Maps/MapInstanced.cpp
@@ -17,15 +17,17 @@
*/
#include "MapInstanced.h"
-#include "ObjectMgr.h"
-#include "MapManager.h"
#include "Battleground.h"
-#include "VMapFactory.h"
-#include "MMapFactory.h"
-#include "InstanceSaveMgr.h"
-#include "World.h"
+#include "DBCStores.h"
#include "Group.h"
+#include "InstanceSaveMgr.h"
+#include "Log.h"
+#include "MapManager.h"
+#include "MMapFactory.h"
+#include "ObjectMgr.h"
#include "Player.h"
+#include "VMapFactory.h"
+#include "World.h"
MapInstanced::MapInstanced(uint32 id, time_t expiry) : Map(id, expiry, 0, DUNGEON_DIFFICULTY_NORMAL)
{
@@ -44,7 +46,7 @@ void MapInstanced::InitVisibilityDistance()
}
}
-void MapInstanced::Update(const uint32 t)
+void MapInstanced::Update(uint32 t)
{
// take care of loaded GridMaps (when unused, unload it!)
Map::Update(t);
@@ -73,7 +75,7 @@ void MapInstanced::Update(const uint32 t)
}
}
-void MapInstanced::DelayedUpdate(const uint32 diff)
+void MapInstanced::DelayedUpdate(uint32 diff)
{
for (InstancedMaps::iterator i = m_InstancedMaps.begin(); i != m_InstancedMaps.end(); ++i)
i->second->DelayedUpdate(diff);
@@ -110,7 +112,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::CreateInstanceForPlayer(const uint32 mapId, Player* player, uint32 loginInstanceId)
+Map* MapInstanced::CreateInstanceForPlayer(uint32 mapId, Player* player, uint32 loginInstanceId /*= 0*/)
{
if (GetId() != mapId || !player)
return nullptr;
@@ -190,7 +192,7 @@ Map* MapInstanced::CreateInstanceForPlayer(const uint32 mapId, Player* player, u
//ASSERT(!FindInstanceMap(NewInstanceId));
map = FindInstanceMap(newInstanceId);
if (!map)
- map = CreateInstance(newInstanceId, NULL, diff);
+ map = CreateInstance(newInstanceId, nullptr, diff);
}
}
@@ -203,13 +205,13 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save,
std::lock_guard<std::mutex> lock(_mapLock);
// make sure we have a valid map id
- const MapEntry* entry = sMapStore.LookupEntry(GetId());
+ MapEntry const* entry = sMapStore.LookupEntry(GetId());
if (!entry)
{
TC_LOG_ERROR("maps", "CreateInstance: no entry for map %d", GetId());
ABORT();
}
- const InstanceTemplate* iTemplate = sObjectMgr->GetInstanceTemplate(GetId());
+ InstanceTemplate const* iTemplate = sObjectMgr->GetInstanceTemplate(GetId());
if (!iTemplate)
{
TC_LOG_ERROR("maps", "CreateInstance: no instance template for map %d", GetId());
@@ -227,7 +229,7 @@ InstanceMap* MapInstanced::CreateInstance(uint32 InstanceId, InstanceSave* save,
map->LoadRespawnTimes();
map->LoadCorpseData();
- bool load_data = save != NULL;
+ bool load_data = save != nullptr;
map->CreateInstanceData(load_data);
if (sWorld->getBoolConfig(CONFIG_INSTANCEMAP_LOAD_GRIDS))