aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-06-10 16:33:09 -0500
committermegamage <none@none>2009-06-10 16:33:09 -0500
commit5daba83c705973c22230a03c4296e267c56002ee (patch)
treeb6e93c512bb90f4a13489d0a260945d5ccd8ca38 /src
parent8fed6e39f5de4c62825bcd87f06189a3637c1541 (diff)
*Move relocation notify back to map class so that mtmap can work better.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Map.cpp8
-rw-r--r--src/game/Map.h1
-rw-r--r--src/game/World.cpp4
3 files changed, 11 insertions, 2 deletions
diff --git a/src/game/Map.cpp b/src/game/Map.cpp
index f3835a851d3..26c94d820d8 100644
--- a/src/game/Map.cpp
+++ b/src/game/Map.cpp
@@ -194,6 +194,8 @@ Map::Map(uint32 id, time_t expiry, uint32 InstanceId, uint8 SpawnMode)
i_gridExpiry(expiry)
, i_lock(true)
{
+ m_notifyTimer.SetInterval(IN_MILISECONDS/2);
+
for(unsigned int idx=0; idx < MAX_NUMBER_OF_GRIDS; ++idx)
{
for(unsigned int j=0; j < MAX_NUMBER_OF_GRIDS; ++j)
@@ -757,6 +759,12 @@ void Map::Update(const uint32 &t_diff)
MoveAllCreaturesInMoveList();
RemoveAllObjectsInRemoveList();
+ if(m_notifyTimer.Passed())
+ {
+ m_notifyTimer.Reset();
+ RelocationNotify();
+ }
+
// Don't unload grids if it's battleground, since we may have manually added GOs,creatures, those doesn't load from DB at grid re-load !
// This isn't really bother us, since as soon as we have instanced BG-s, the whole map unloads as the BG gets ended
if (IsBattleGroundOrArena())
diff --git a/src/game/Map.h b/src/game/Map.h
index 514308c699a..4caa1942c3c 100644
--- a/src/game/Map.h
+++ b/src/game/Map.h
@@ -495,6 +495,7 @@ class MANGOS_DLL_SPEC Map : public GridRefManager<NGridType>, public MaNGOS::Obj
std::bitset<TOTAL_NUMBER_OF_CELLS_PER_MAP*TOTAL_NUMBER_OF_CELLS_PER_MAP> marked_cells;
time_t i_gridExpiry;
+ IntervalTimer m_notifyTimer;
bool i_lock;
std::vector<Unit*> i_unitsToNotifyBacklog;
diff --git a/src/game/World.cpp b/src/game/World.cpp
index 92453ce1f52..3da26c01a05 100644
--- a/src/game/World.cpp
+++ b/src/game/World.cpp
@@ -1752,11 +1752,11 @@ void World::Update(uint32 diff)
///- Update objects when the timer has passed (maps, transport, creatures,...)
MapManager::Instance().Update(diff); // As interval = 0
- if(m_timers[WUPDATE_OBJECTS].Passed())
+ /*if(m_timers[WUPDATE_OBJECTS].Passed())
{
m_timers[WUPDATE_OBJECTS].Reset();
MapManager::Instance().DoDelayedMovesAndRemoves();
- }
+ }*/
///- Process necessary scripts
if (!m_scriptSchedule.empty())