summaryrefslogtreecommitdiff
path: root/src/game/Maps/Map.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/Maps/Map.cpp')
-rw-r--r--src/game/Maps/Map.cpp60
1 files changed, 45 insertions, 15 deletions
diff --git a/src/game/Maps/Map.cpp b/src/game/Maps/Map.cpp
index 5fa7b8d759..ffae01742a 100644
--- a/src/game/Maps/Map.cpp
+++ b/src/game/Maps/Map.cpp
@@ -114,13 +114,19 @@ void Map::LoadMMap(int gx, int gy)
switch (mmapLoadResult)
{
case MMAP::MMAP_LOAD_RESULT_OK:
- ;//sLog->outDetail("MMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
+ sLog->outDetail("MMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+#endif
break;
case MMAP::MMAP_LOAD_RESULT_ERROR:
- ;//sLog->outDetail("Could not load MMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
+ sLog->outDetail("Could not load MMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+#endif
break;
case MMAP::MMAP_LOAD_RESULT_IGNORED:
- ;//sLog->outStaticDebug("Ignored MMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
+ sLog->outStaticDebug("Ignored MMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+#endif
break;
}
}
@@ -132,13 +138,19 @@ void Map::LoadVMap(int gx, int gy)
switch (vmapLoadResult)
{
case VMAP::VMAP_LOAD_RESULT_OK:
- ;//sLog->outDetail("VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
+ sLog->outDetail("VMAP loaded name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+#endif
break;
case VMAP::VMAP_LOAD_RESULT_ERROR:
- ;//sLog->outDetail("Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
+ sLog->outDetail("Could not load VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+#endif
break;
case VMAP::VMAP_LOAD_RESULT_IGNORED:
- ;//sLog->outStaticDebug("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
+ sLog->outStaticDebug("Ignored VMAP name:%s, id:%d, x:%d, y:%d (vmap rep.: x:%d, y:%d)", GetMapName(), GetId(), gx, gy, gx, gy);
+#endif
break;
}
}
@@ -163,7 +175,9 @@ void Map::LoadMap(int gx, int gy, bool reload)
//map already load, delete it before reloading (Is it necessary? Do we really need the ability the reload maps during runtime?)
if (GridMaps[gx][gy])
{
- ;//sLog->outDetail("Unloading previously loaded map %u before reloading.", GetId());
+#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
+ sLog->outDetail("Unloading previously loaded map %u before reloading.", GetId());
+#endif
sScriptMgr->OnUnloadGridMap(this, GridMaps[gx][gy], gx, gy);
delete (GridMaps[gx][gy]);
@@ -175,7 +189,9 @@ void Map::LoadMap(int gx, int gy, bool reload)
int len = sWorld->GetDataPath().length()+strlen("maps/%03u%02u%02u.map")+1;
tmp = new char[len];
snprintf(tmp, len, (char *)(sWorld->GetDataPath()+"maps/%03u%02u%02u.map").c_str(), GetId(), gx, gy);
- ;//sLog->outDetail("Loading map %s", tmp);
+#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
+ sLog->outDetail("Loading map %s", tmp);
+#endif
// loading data
GridMaps[gx][gy] = new GridMap();
if (!GridMaps[gx][gy]->loadData(tmp))
@@ -300,7 +316,9 @@ void Map::SwitchGridContainers(Creature* obj, bool on)
if (!IsGridLoaded(GridCoord(cell.data.Part.grid_x, cell.data.Part.grid_y)))
return;
- ;//sLog->outStaticDebug("Switch object " UI64FMTD " from grid[%u, %u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on);
+#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
+ sLog->outStaticDebug("Switch object " UI64FMTD " from grid[%u, %u] %u", obj->GetGUID(), cell.data.Part.grid_x, cell.data.Part.grid_y, on);
+#endif
NGridType *ngrid = getNGrid(cell.GridX(), cell.GridY());
ASSERT(ngrid != NULL);
@@ -424,7 +442,9 @@ bool Map::EnsureGridLoaded(const Cell &cell)
{
//if (!isGridObjectDataLoaded(cell.GridX(), cell.GridY()))
//{
- ;//sLog->outDebug(LOG_FILTER_MAPS, "Loading grid[%u, %u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId);
+#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
+ sLog->outDebug(LOG_FILTER_MAPS, "Loading grid[%u, %u] for map %u instance %u", cell.GridX(), cell.GridY(), GetId(), i_InstanceId);
+#endif
setGridObjectDataLoaded(true, cell.GridX(), cell.GridY());
@@ -1120,7 +1140,9 @@ bool Map::UnloadGrid(NGridType& ngrid)
GridMaps[gx][gy] = NULL;
- ;//sLog->outStaticDebug("Unloading grid[%u, %u] for map %u finished", x, y, GetId());
+#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
+ sLog->outStaticDebug("Unloading grid[%u, %u] for map %u finished", x, y, GetId());
+#endif
return true;
}
@@ -1862,7 +1884,9 @@ bool Map::IsOutdoors(float x, float y, float z) const
WMOAreaTableEntry const* wmoEntry= GetWMOAreaTableEntryByTripple(rootId, adtId, groupId);
if (wmoEntry)
{
- ;//sLog->outStaticDebug("Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->areaId);
+#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
+ sLog->outStaticDebug("Got WMOAreaTableEntry! flag %u, areaid %u", wmoEntry->Flags, wmoEntry->areaId);
+#endif
atEntry = GetAreaEntryByAreaID(wmoEntry->areaId);
}
return IsOutdoorWMO(mogpFlags, adtId, rootId, groupId, wmoEntry, atEntry);
@@ -1943,7 +1967,9 @@ ZLiquidStatus Map::getLiquidStatus(float x, float y, float z, uint8 ReqLiquidTyp
uint32 liquid_type = 0;
if (vmgr->GetLiquidLevel(GetId(), x, y, z, ReqLiquidType, liquid_level, ground_level, liquid_type))
{
- ;//sLog->outDebug(LOG_FILTER_MAPS, "getLiquidStatus(): vmap liquid level: %f ground: %f type: %u", liquid_level, ground_level, liquid_type);
+#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
+ sLog->outDebug(LOG_FILTER_MAPS, "getLiquidStatus(): vmap liquid level: %f ground: %f type: %u", liquid_level, ground_level, liquid_type);
+#endif
// Check water level and ground level
if (liquid_level > ground_level && z > ground_level - 2)
{
@@ -2102,7 +2128,9 @@ char const* Map::GetMapName() const
void Map::SendInitSelf(Player* player)
{
- ;//sLog->outDetail("Creating player data for himself %u", player->GetGUIDLow());
+#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
+ sLog->outDetail("Creating player data for himself %u", player->GetGUIDLow());
+#endif
UpdateData data;
@@ -2435,7 +2463,9 @@ bool InstanceMap::CanEnter(Player* player, bool loginCheck)
uint32 maxPlayers = GetMaxPlayers();
if (GetPlayersCountExceptGMs() >= (loginCheck ? maxPlayers+1 : maxPlayers))
{
- ;//sLog->outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName().c_str());
+#if defined(ENABLE_EXTRAS) && defined(ENABLE_EXTRA_LOGS)
+ sLog->outDetail("MAP: Instance '%u' of map '%s' cannot have more than '%u' players. Player '%s' rejected", GetInstanceId(), GetMapName(), maxPlayers, player->GetName().c_str());
+#endif
player->SendTransferAborted(GetId(), TRANSFER_ABORT_MAX_PLAYERS);
return false;
}