summaryrefslogtreecommitdiff
path: root/src/navigationmanager.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2017-06-06 23:34:34 +0300
committerAndrei Karas <akaras@inbox.ru>2017-06-07 19:23:40 +0300
commit36ba43d6ea38062b17f7e63ef659962bfc51c64d (patch)
tree190156cb88b13a38a6d13c69ee0742cc078065a1 /src/navigationmanager.cpp
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadplus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz
plus-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/navigationmanager.cpp')
-rw-r--r--src/navigationmanager.cpp23
1 files changed, 12 insertions, 11 deletions
diff --git a/src/navigationmanager.cpp b/src/navigationmanager.cpp
index 46fc40cbe..67d5760f0 100644
--- a/src/navigationmanager.cpp
+++ b/src/navigationmanager.cpp
@@ -62,7 +62,7 @@ NavigationManager::~NavigationManager()
#ifndef DYECMD
Resource *NavigationManager::loadWalkLayer(const Map *const map)
{
- if (!map)
+ if (map == nullptr)
return nullptr;
const int width = map->getWidth();
@@ -73,7 +73,7 @@ Resource *NavigationManager::loadWalkLayer(const Map *const map)
const MetaTile *const tiles = map->getMetaTiles();
int *const data = walkLayer->getData();
- if (!tiles || !data)
+ if ((tiles == nullptr) || (data == nullptr))
return walkLayer;
int x = 0;
@@ -108,9 +108,9 @@ void NavigationManager::fillNum(int x, int y,
if (x > 0)
{
ptr = (x - 1) + width * y;
- if (!data[ptr])
+ if (data[ptr] == 0)
{
- if (!(tiles[ptr].blockmask & blockWalkMask))
+ if ((tiles[ptr].blockmask & blockWalkMask) == 0)
cells.push_back(Cell(x - 1, y));
else
data[ptr] = -num;
@@ -119,9 +119,9 @@ void NavigationManager::fillNum(int x, int y,
if (x < width - 1)
{
ptr = (x + 1) + width * y;
- if (!data[ptr])
+ if (data[ptr] == 0)
{
- if (!(tiles[ptr].blockmask & blockWalkMask))
+ if ((tiles[ptr].blockmask & blockWalkMask) == 0)
cells.push_back(Cell(x + 1, y));
else
data[ptr] = -num;
@@ -130,9 +130,9 @@ void NavigationManager::fillNum(int x, int y,
if (y > 0)
{
ptr = x + width * (y - 1);
- if (!data[ptr])
+ if (data[ptr] == 0)
{
- if (!(tiles[ptr].blockmask & blockWalkMask))
+ if ((tiles[ptr].blockmask & blockWalkMask) == 0)
cells.push_back(Cell(x, y - 1));
else
data[ptr] = -num;
@@ -141,9 +141,9 @@ void NavigationManager::fillNum(int x, int y,
if (y < height - 1)
{
ptr = x + width * (y + 1);
- if (!data[ptr])
+ if (data[ptr] == 0)
{
- if (!(tiles[ptr].blockmask & blockWalkMask))
+ if ((tiles[ptr].blockmask & blockWalkMask) == 0)
cells.push_back(Cell(x, y + 1));
else
data[ptr] = -num;
@@ -164,7 +164,8 @@ bool NavigationManager::findWalkableTile(int &x1, int &y1,
for (int x = 0; x < width; x ++)
{
const int ptr = x + y2;
- if (!(tiles[ptr].blockmask & blockWalkMask) && !data[ptr])
+ if (((tiles[ptr].blockmask & blockWalkMask) == 0) &&
+ data[ptr] == 0)
{
x1 = x;
y1 = y;