Skip to content
Browse files

Core: Fix compile with WITH_COREDEBUG option enabled

  • Loading branch information...
1 parent 5128793 commit d7d62e4248d70866bce56b72b42302fdc6d6b7b5 @Spp- Spp- committed Mar 26, 2013
View
45 src/server/game/Grids/GridStates.cpp
@@ -18,53 +18,58 @@
#include "GridStates.h"
#include "GridNotifiers.h"
-#include "Grid.h"
#include "Log.h"
-void InvalidState::Update(Map &, NGridType &, GridInfo &, const uint32) const
+#ifdef TRINITY_DEBUG
+bool GridState::checkMagic()
{
+ if (i_Magic != MAGIC_TESTVAL)
+ {
+ sLog->outError(LOG_FILTER_GENERAL, "!!! GridState: Magic value gone !!!");
+ return false;
+ }
+ return true;
}
+#endif
+
+void InvalidState::Update(Map&, NGridType&, GridInfo&, uint32) const
+{ }
-void ActiveState::Update(Map &m, NGridType &grid, GridInfo & info, const uint32 t_diff) const
+void ActiveState::Update(Map& map, NGridType& grid, GridInfo& info, uint32 diff) const
{
// Only check grid activity every (grid_expiry/10) ms, because it's really useless to do it every cycle
- info.UpdateTimeTracker(t_diff);
+ info.UpdateTimeTracker(diff);
if (info.getTimeTracker().Passed())
{
- if (!grid.GetWorldObjectCountInNGrid<Player>() && !m.ActiveObjectsNearGrid(grid))
+ if (!grid.GetWorldObjectCountInNGrid<Player>() && !map.ActiveObjectsNearGrid(grid))
{
ObjectGridStoper worker;
TypeContainerVisitor<ObjectGridStoper, GridTypeMapContainer> visitor(worker);
grid.VisitAllGrids(visitor);
grid.SetGridState(GRID_STATE_IDLE);
- sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] on map %u moved to IDLE state", grid.getX(), grid.getY(), m.GetId());
+ sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] on map %u moved to IDLE state", grid.getX(), grid.getY(), map.GetId());
}
else
- {
- m.ResetGridExpiry(grid, 0.1f);
- }
+ map.ResetGridExpiry(grid, 0.1f);
}
}
-void IdleState::Update(Map &m, NGridType &grid, GridInfo &, const uint32) const
+void IdleState::Update(Map& map, NGridType& grid, GridInfo&, uint32) const
{
- m.ResetGridExpiry(grid);
+ map.ResetGridExpiry(grid);
grid.SetGridState(GRID_STATE_REMOVAL);
- sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] on map %u moved to REMOVAL state", grid.getX(), grid.getY(), m.GetId());
+ sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] on map %u moved to REMOVAL state", grid.getX(), grid.getY(), map.GetId());
}
-void RemovalState::Update(Map &m, NGridType &grid, GridInfo &info, const uint32 t_diff) const
+void RemovalState::Update(Map& map, NGridType& grid, GridInfo& info, uint32 diff) const
{
if (!info.getUnloadLock())
{
- info.UpdateTimeTracker(t_diff);
- if (info.getTimeTracker().Passed())
+ info.UpdateTimeTracker(diff);
+ if (info.getTimeTracker().Passed() && !map.UnloadGrid(grid, false))
{
- if (!m.UnloadGrid(grid, false))
- {
- sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] for map %u differed unloading due to players or active objects nearby", grid.getX(), grid.getY(), m.GetId());
- m.ResetGridExpiry(grid);
- }
+ sLog->outDebug(LOG_FILTER_MAPS, "Grid[%u, %u] for map %u differed unloading due to players or active objects nearby", grid.getX(), grid.getY(), map.GetId());
+ map.ResetGridExpiry(grid);
}
}
}
View
27 src/server/game/Grids/GridStates.h
@@ -19,53 +19,46 @@
#ifndef TRINITY_GRIDSTATES_H
#define TRINITY_GRIDSTATES_H
-#include "Map.h"
-#include "Object.h"
+#include "GridDefines.h"
+#include "NGrid.h"
+
+class Map;
class GridState
{
public:
#ifdef TRINITY_DEBUG
#define MAGIC_TESTVAL 0xFBE823BA
GridState() { i_Magic = MAGIC_TESTVAL; }
- bool checkMagic()
- {
- if (i_Magic != MAGIC_TESTVAL)
- {
- sLog->outError(LOG_FILTER_GENERAL, "!!! GridState: Magic value gone !!!");
- return false;
- }
- return true;
- }
+ bool checkMagic();
void setMagic() { i_Magic = MAGIC_TESTVAL; }
unsigned int i_Magic;
#endif
virtual ~GridState() {};
- virtual void Update(Map &, NGridType&, GridInfo &, const uint32 t_diff) const = 0;
+ virtual void Update(Map &, NGridType&, GridInfo &, uint32 t_diff) const = 0;
};
class InvalidState : public GridState
{
public:
- void Update(Map &, NGridType &, GridInfo &, const uint32 t_diff) const;
+ void Update(Map &, NGridType &, GridInfo &, uint32 t_diff) const;
};
class ActiveState : public GridState
{
public:
- void Update(Map &, NGridType &, GridInfo &, const uint32 t_diff) const;
+ void Update(Map &, NGridType &, GridInfo &, uint32 t_diff) const;
};
class IdleState : public GridState
{
public:
- void Update(Map &, NGridType &, GridInfo &, const uint32 t_diff) const;
+ void Update(Map &, NGridType &, GridInfo &, uint32 t_diff) const;
};
class RemovalState : public GridState
{
public:
- void Update(Map &, NGridType &, GridInfo &, const uint32 t_diff) const;
+ void Update(Map &, NGridType &, GridInfo &, uint32 t_diff) const;
};
#endif
-
View
9 src/server/game/Maps/MapManager.h
@@ -19,14 +19,15 @@
#ifndef TRINITY_MAPMANAGER_H
#define TRINITY_MAPMANAGER_H
-#include "Define.h"
-#include <ace/Singleton.h>
-#include <ace/Thread_Mutex.h>
-#include "Common.h"
+#include "Object.h"
#include "Map.h"
#include "GridStates.h"
#include "MapUpdater.h"
+#include <ace/Singleton.h>
+#include <ace/Thread_Mutex.h>
+
+
class Transport;
struct TransportCreatureProto;
View
1 src/server/shared/Packets/ByteBuffer.cpp
@@ -17,6 +17,7 @@
*/
#include "ByteBuffer.h"
+#include "Common.h"
#include "Log.h"
#include <ace/Stack_Trace.h>
View
6 src/server/shared/Packets/ByteBuffer.h
@@ -20,16 +20,16 @@
#define _BYTEBUFFER_H
#include "Define.h"
-#include "Debugging/Errors.h"
-#include "Utilities/ByteConverter.h"
+#include "Errors.h"
+#include "ByteConverter.h"
#include <exception>
#include <list>
#include <map>
#include <string>
#include <vector>
-
#include <cstring>
+#include <time.h>
// Root of ByteBuffer exception hierarchy
class ByteBufferException : public std::exception

1 comment on commit d7d62e4

@Spp-
Spp- commented on d7d62e4 Mar 26, 2013

Missing "closes #9505 "

Please sign in to comment.
Something went wrong with that request. Please try again.