aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/Map.cpp
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2012-11-19 10:09:58 +0100
committerSpp <spp@jorge.gr>2012-11-19 10:09:58 +0100
commit7f061fc57fac4b48417d25579e833e9b66364237 (patch)
treecdbe2ff223967034dd9f236da4ca38cc73c30a7b /src/server/game/Maps/Map.cpp
parent09ab26ac946bc7b5458d92fbadfb66e442744098 (diff)
parentd42212b595ad01be0a839405d853f7db2b9f88de (diff)
Merge branch 'master' into 4.3.4
Conflicts: src/server/game/AI/EventAI/CreatureEventAI.cpp src/server/game/AI/EventAI/CreatureEventAIMgr.cpp src/server/game/AI/EventAI/CreatureEventAIMgr.h src/server/game/Battlegrounds/Battleground.h src/server/game/Chat/Chat.h src/server/game/Entities/Player/Player.cpp src/server/game/Globals/ObjectMgr.cpp src/server/game/Globals/ObjectMgr.h src/server/game/Guilds/Guild.cpp src/server/game/Handlers/CharacterHandler.cpp src/server/game/Handlers/MailHandler.cpp src/server/game/Miscellaneous/SharedDefines.h src/server/game/Server/Protocol/Opcodes.cpp src/server/game/Spells/SpellInfo.cpp src/server/game/World/World.cpp src/server/scripts/Commands/cs_modify.cpp src/server/scripts/Commands/cs_reload.cpp src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_northrend_beasts.cpp src/server/shared/Database/Implementation/CharacterDatabase.cpp
Diffstat (limited to 'src/server/game/Maps/Map.cpp')
-rwxr-xr-xsrc/server/game/Maps/Map.cpp37
1 files changed, 20 insertions, 17 deletions
diff --git a/src/server/game/Maps/Map.cpp b/src/server/game/Maps/Map.cpp
index f3c1a335f5e..cf773ba7ead 100755
--- a/src/server/game/Maps/Map.cpp
+++ b/src/server/game/Maps/Map.cpp
@@ -33,6 +33,7 @@
#include "LFGMgr.h"
#include "DynamicTree.h"
#include "Vehicle.h"
+#include "Battleground.h"
union u_map_magic
{
@@ -144,7 +145,7 @@ void Map::LoadMap(int gx, int gy, bool reload)
// load grid map for base map
if (!m_parentMap->GridMaps[gx][gy])
- m_parentMap->EnsureGridCreated(GridCoord(63-gx, 63-gy));
+ m_parentMap->EnsureGridCreated_i(GridCoord(63-gx, 63-gy));
((MapInstanced*)(m_parentMap))->AddGridMapReference(GridCoord(gx, gy));
GridMaps[gx][gy] = m_parentMap->GridMaps[gx][gy];
@@ -307,32 +308,34 @@ void Map::DeleteFromWorld(Player* player)
delete player;
}
+void Map::EnsureGridCreated(const GridCoord &p)
+{
+ TRINITY_GUARD(ACE_Thread_Mutex, Lock);
+ EnsureGridCreated_i(p);
+}
+
//Create NGrid so the object can be added to it
//But object data is not loaded here
-void Map::EnsureGridCreated(const GridCoord &p)
+void Map::EnsureGridCreated_i(const GridCoord &p)
{
if (!getNGrid(p.x_coord, p.y_coord))
{
- TRINITY_GUARD(ACE_Thread_Mutex, Lock);
- if (!getNGrid(p.x_coord, p.y_coord))
- {
- sLog->outDebug(LOG_FILTER_MAPS, "Creating grid[%u, %u] for map %u instance %u", p.x_coord, p.y_coord, GetId(), i_InstanceId);
+ sLog->outDebug(LOG_FILTER_MAPS, "Creating grid[%u, %u] for map %u instance %u", p.x_coord, p.y_coord, GetId(), i_InstanceId);
- setNGrid(new NGridType(p.x_coord*MAX_NUMBER_OF_GRIDS + p.y_coord, p.x_coord, p.y_coord, i_gridExpiry, sWorld->getBoolConfig(CONFIG_GRID_UNLOAD)),
- p.x_coord, p.y_coord);
+ setNGrid(new NGridType(p.x_coord*MAX_NUMBER_OF_GRIDS + p.y_coord, p.x_coord, p.y_coord, i_gridExpiry, sWorld->getBoolConfig(CONFIG_GRID_UNLOAD)),
+ p.x_coord, p.y_coord);
- // build a linkage between this map and NGridType
- buildNGridLinkage(getNGrid(p.x_coord, p.y_coord));
+ // build a linkage between this map and NGridType
+ buildNGridLinkage(getNGrid(p.x_coord, p.y_coord));
- getNGrid(p.x_coord, p.y_coord)->SetGridState(GRID_STATE_IDLE);
+ getNGrid(p.x_coord, p.y_coord)->SetGridState(GRID_STATE_IDLE);
- //z coord
- int gx = (MAX_NUMBER_OF_GRIDS - 1) - p.x_coord;
- int gy = (MAX_NUMBER_OF_GRIDS - 1) - p.y_coord;
+ //z coord
+ int gx = (MAX_NUMBER_OF_GRIDS - 1) - p.x_coord;
+ int gy = (MAX_NUMBER_OF_GRIDS - 1) - p.y_coord;
- if (!GridMaps[gx][gy])
- LoadMapAndVMap(gx, gy);
- }
+ if (!GridMaps[gx][gy])
+ LoadMapAndVMap(gx, gy);
}
}