aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Maps/Map.h
diff options
context:
space:
mode:
authormegamage <none@none.none>2011-10-07 17:36:23 -0400
committermegamage <none@none.none>2011-10-07 17:36:23 -0400
commiteb8cbae0d5d2e43585300271db86c4bd0bacd58a (patch)
treed63028a4cdfedcd3c7f7bc26039beb3ec2fd3192 /src/server/game/Maps/Map.h
parent381cf2f9d3a8bfddea02574987ff64e26d1889d4 (diff)
Fix the relocation of creatures across cells. Try to fix #3054.
Diffstat (limited to 'src/server/game/Maps/Map.h')
-rwxr-xr-xsrc/server/game/Maps/Map.h18
1 files changed, 6 insertions, 12 deletions
diff --git a/src/server/game/Maps/Map.h b/src/server/game/Maps/Map.h
index 640b70413f8..ff6bdac5156 100755
--- a/src/server/game/Maps/Map.h
+++ b/src/server/game/Maps/Map.h
@@ -193,14 +193,6 @@ public:
ZLiquidStatus getLiquidStatus(float x, float y, float z, uint8 ReqLiquidType, LiquidData* data = 0);
};
-struct CreatureMover
-{
- CreatureMover() : x(0.0f), y(0.0f), z(0.0f), ang(0.0f) {}
- CreatureMover(float _x, float _y, float _z, float _ang) : x(_x), y(_y), z(_z), ang(_ang) {}
-
- float x, y, z, ang;
-};
-
// GCC have alternative #pragma pack(N) syntax and old gcc version not support pack(push, N), also any gcc version not support it at some platform
#if defined(__GNUC__)
#pragma pack(1)
@@ -226,8 +218,6 @@ enum LevelRequirementVsMode
#pragma pack(pop)
#endif
-typedef UNORDERED_MAP<Creature*, CreatureMover> CreatureMoveList;
-
#define MAX_HEIGHT 100000.0f // can be use for find ground height at surface
#define INVALID_HEIGHT -100000.0f // for check, must be equal to VMAP_INVALID_HEIGHT, real value for unknown height is VMAP_INVALID_HEIGHT_VALUE
#define MAX_FALL_DISTANCE 250000.0f // "unlimited fall" to find VMap ground if it is available, just larger than MAX_HEIGHT - INVALID_HEIGHT
@@ -344,7 +334,8 @@ class Map : public GridRefManager<NGridType>
void RemoveAllObjectsInRemoveList();
virtual void RemoveAllPlayers();
- bool CreatureRespawnRelocation(Creature* c); // used only in MoveAllCreaturesInMoveList and ObjectGridUnloader
+ // used only in MoveAllCreaturesInMoveList and ObjectGridUnloader
+ bool CreatureRespawnRelocation(Creature* c, bool diffGridOnly);
// assert print helper
bool CheckGridIntegrity(Creature* c, bool moved) const;
@@ -449,8 +440,11 @@ class Map : public GridRefManager<NGridType>
bool CreatureCellRelocation(Creature* creature, Cell new_cell);
+ template<class T> void InitializeObject(T* obj);
void AddCreatureToMoveList(Creature* c, float x, float y, float z, float ang);
- CreatureMoveList i_creaturesToMove;
+ void RemoveCreatureFromMoveList(Creature* c);
+ bool _creatureToMoveLock;
+ std::vector<Creature*> _creaturesToMove;
bool loaded(const GridPair &) const;
void EnsureGridCreated(const GridPair &);