diff options
author | Andrei Karas <akaras@inbox.ru> | 2017-06-06 23:34:34 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2017-06-07 19:23:40 +0300 |
commit | 36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch) | |
tree | 190156cb88b13a38a6d13c69ee0742cc078065a1 /src/resources/map/speciallayer.cpp | |
parent | f1518dd8476c968a43fa57cfb06198e290a4f77a (diff) | |
download | ManaVerse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz ManaVerse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2 ManaVerse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz ManaVerse-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip |
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/resources/map/speciallayer.cpp')
-rw-r--r-- | src/resources/map/speciallayer.cpp | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/resources/map/speciallayer.cpp b/src/resources/map/speciallayer.cpp index 4e826dc42..75b56be28 100644 --- a/src/resources/map/speciallayer.cpp +++ b/src/resources/map/speciallayer.cpp @@ -72,7 +72,7 @@ void SpecialLayer::setTile(const int x, const int y, MapItem *const item) const int idx = x + y * mWidth; delete mTiles[idx]; - if (item) + if (item != nullptr) item->setPos(x, y); mTiles[idx] = item; } @@ -87,7 +87,7 @@ void SpecialLayer::setTile(const int x, const int y, const int type) const int idx = x + y * mWidth; MapItem *const tile = mTiles[idx]; - if (tile) + if (tile != nullptr) { tile->setType(type); tile->setPos(x, y); @@ -105,7 +105,7 @@ void SpecialLayer::addRoad(const Path &road) { const Position &pos = (*i); MapItem *const item = getTile(pos.x, pos.y); - if (!item) + if (item == nullptr) setTile(pos.x, pos.y, new MapItem(MapItemType::ROAD)); else item->setType(MapItemType::ROAD); @@ -115,13 +115,13 @@ void SpecialLayer::addRoad(const Path &road) void SpecialLayer::clean() { - if (!mTiles) + if (mTiles == nullptr) return; for (int f = 0; f < mWidth * mHeight; f ++) { MapItem *const item = mTiles[f]; - if (item) + if (item != nullptr) item->setType(MapItemType::EMPTY); } updateCache(); @@ -148,7 +148,7 @@ void SpecialLayer::draw(Graphics *const graphics, int startX, int startY, for (int x = startX; x < endX; x ++) { const MapItem *const item = mTiles[x + y2]; - if (item) + if (item != nullptr) { item->draw(graphics, x * mapTileSize - scrollX, py, mapTileSize, mapTileSize); |