diff options
author | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2022-08-19 17:34:12 +0200 |
---|---|---|
committer | Thorbjørn Lindeijer <bjorn@lindeijer.nl> | 2022-08-19 17:34:55 +0200 |
commit | 2effe9775db423d61d8a2bdd15c40e6015bac6f5 (patch) | |
tree | c39246dbbd85c66987dd8c2c071648f2da7eaede /src/game-server/map.cpp | |
parent | 109b602701578b9f2b29282f84bf2757544f8d32 (diff) | |
download | manaserv-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.cpp | 13 |
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 |