summaryrefslogtreecommitdiff
path: root/src/game-server/map.cpp
diff options
context:
space:
mode:
authorThorbjørn Lindeijer <bjorn@lindeijer.nl>2022-08-19 17:34:12 +0200
committerThorbjørn Lindeijer <bjorn@lindeijer.nl>2022-08-19 17:34:55 +0200
commit2effe9775db423d61d8a2bdd15c40e6015bac6f5 (patch)
treec39246dbbd85c66987dd8c2c071648f2da7eaede /src/game-server/map.cpp
parent109b602701578b9f2b29282f84bf2757544f8d32 (diff)
downloadmanaserv-2effe9775db423d61d8a2bdd15c40e6015bac6f5.tar.gz
manaserv-2effe9775db423d61d8a2bdd15c40e6015bac6f5.tar.bz2
manaserv-2effe9775db423d61d8a2bdd15c40e6015bac6f5.tar.xz
manaserv-2effe9775db423d61d8a2bdd15c40e6015bac6f5.zip
Apply C++11 fixits
modernize-loop-convert modernize-deprecated-headers
Diffstat (limited to 'src/game-server/map.cpp')
-rw-r--r--src/game-server/map.cpp13
1 files changed, 6 insertions, 7 deletions
diff --git a/src/game-server/map.cpp b/src/game-server/map.cpp
index 0f7fea60..ad68b13e 100644
--- a/src/game-server/map.cpp
+++ b/src/game-server/map.cpp
@@ -19,10 +19,10 @@
*/
#include <algorithm>
-#include <queue>
#include <cassert>
+#include <climits>
#include <cstring>
-#include <limits.h>
+#include <queue>
#include "game-server/map.h"
@@ -109,10 +109,9 @@ Map::Map(int width, int height, int tileWidth, int tileHeight):
Map::~Map()
{
- for (auto it = mMapObjects.begin();
- it != mMapObjects.end(); ++it)
+ for (auto mapObject : mMapObjects)
{
- delete *it;
+ delete mapObject;
}
}
@@ -394,8 +393,8 @@ void FindPath::prepare(const Map *map)
// Reset closed and open list IDs and clear the whichList values
mOnClosedList = 1;
mOnOpenList = 2;
- for (unsigned i = 0, end = mPathInfos.size(); i < end; ++i)
- mPathInfos[i].whichList = 0;
+ for (auto &pathInfo : mPathInfos)
+ pathInfo.whichList = 0;
}
// Make sure we have enough room to cover this map with path information