summaryrefslogtreecommitdiffstats
path: root/src/MobProximityCounter.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/MobProximityCounter.h')
-rw-r--r--src/MobProximityCounter.h17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/MobProximityCounter.h b/src/MobProximityCounter.h
index 8a67139aa..2dabeaa21 100644
--- a/src/MobProximityCounter.h
+++ b/src/MobProximityCounter.h
@@ -16,9 +16,9 @@ protected :
// structs used for later maps (see m_MonsterToDistance and m_DistanceToMonster)
struct sDistanceAndChunk
{
- sDistanceAndChunk(double a_Distance, cChunk& a_Chunk) : m_Distance(a_Distance), m_Chunk(a_Chunk) {}
+ sDistanceAndChunk(double a_Distance, cChunk& a_Chunk) : m_Distance(a_Distance), m_Chunk(&a_Chunk) {}
double m_Distance;
- cChunk& m_Chunk;
+ cChunk* m_Chunk;
};
struct sMonsterAndChunk
{
@@ -27,11 +27,11 @@ protected :
cChunk& m_Chunk;
};
-public :
- typedef std::map<cEntity*,sDistanceAndChunk> tMonsterToDistance;
- typedef std::multimap<double,sMonsterAndChunk> tDistanceToMonster;
+public :
+ typedef std::map<cEntity*, sDistanceAndChunk> tMonsterToDistance;
+ typedef std::multimap<double, sMonsterAndChunk> tDistanceToMonster;
-protected :
+protected :
// this map is filled during collection phase, it will be later transformed into DistanceToMonster
tMonsterToDistance m_MonsterToDistance;
@@ -41,7 +41,7 @@ protected :
// this are the collected chunks. Used to determinate the number of elligible chunk for spawning.
std::set<cChunk*> m_EligibleForSpawnChunks;
-protected :
+protected :
// transform monsterToDistance map (that was usefull for collecting) into distanceToMonster
// that will be usefull for picking up.
void convertMaps();
@@ -55,7 +55,8 @@ public :
// return the mobs that are within the range of distance of the closest player they are
// that means that if a mob is 30 m from a player and 150 m from another one. It will be
// in the range [0..50] but not in [100..200]
- struct sIterablePair{
+ struct sIterablePair
+ {
tDistanceToMonster::const_iterator m_Begin;
tDistanceToMonster::const_iterator m_End;
int m_Count;