summaryrefslogtreecommitdiff
path: root/src/gamemodifiers.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/gamemodifiers.cpp
parentf1518dd8476c968a43fa57cfb06198e290a4f77a (diff)
downloadmv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.gz
mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.bz2
mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.tar.xz
mv-36ba43d6ea38062b17f7e63ef659962bfc51c64d.zip
Fix clang-tidy check readability-implicit-bool-cast.
Diffstat (limited to 'src/gamemodifiers.cpp')
-rw-r--r--src/gamemodifiers.cpp22
1 files changed, 11 insertions, 11 deletions
diff --git a/src/gamemodifiers.cpp b/src/gamemodifiers.cpp
index 9d4f6a64a..13a92f082 100644
--- a/src/gamemodifiers.cpp
+++ b/src/gamemodifiers.cpp
@@ -108,7 +108,7 @@ void GameModifiers::changeMode(unsigned *restrict const var,
const bool save,
const bool forward)
{
- if (!var)
+ if (var == nullptr)
return;
if (forward)
@@ -119,7 +119,7 @@ void GameModifiers::changeMode(unsigned *restrict const var,
}
else
{
- if (!*var)
+ if (*var == 0u)
*var = limit - 1;
else
(*var) --;
@@ -408,7 +408,7 @@ addModifier(MapDrawType, mapDrawType, 7,
void GameModifiers::changeMapDrawType(const bool forward A_UNUSED)
{
- if (viewport)
+ if (viewport != nullptr)
viewport->toggleMapDrawType();
}
@@ -424,7 +424,7 @@ addModifier(AwayMode, awayMode, 2,
void GameModifiers::changeAwayMode(const bool forward A_UNUSED)
{
- if (!localPlayer)
+ if (localPlayer == nullptr)
return;
settings.awayMode = !settings.awayMode;
@@ -436,12 +436,12 @@ void GameModifiers::changeAwayMode(const bool forward A_UNUSED)
GameModifierListener::distributeEvent();
if (settings.awayMode)
{
- if (chatWindow)
+ if (chatWindow != nullptr)
chatWindow->clearAwayLog();
localPlayer->cancelFollow();
localPlayer->navigateClean();
- if (outfitWindow)
+ if (outfitWindow != nullptr)
outfitWindow->wearAwayOutfit();
OkDialog *const dialog = CREATEWIDGETR(OkDialog,
// TRANSLATORS: away message box header
@@ -463,7 +463,7 @@ void GameModifiers::changeAwayMode(const bool forward A_UNUSED)
{
localPlayer->setAwayDialog(nullptr);
soundManager.volumeRestore();
- if (chatWindow)
+ if (chatWindow != nullptr)
{
chatWindow->displayAwayLog();
chatWindow->clearAwayLog();
@@ -485,7 +485,7 @@ addModifier(CameraMode, cameraMode, 2,
void GameModifiers::changeCameraMode(const bool forward A_UNUSED)
{
- if (viewport)
+ if (viewport != nullptr)
viewport->toggleCameraMode();
}
@@ -503,12 +503,12 @@ void GameModifiers::resetModifiers()
settings.pickUpType = config.resetIntValue("pickUpType");
settings.targetingType = config.resetIntValue("targetingType");
settings.mapDrawType = MapType::NORMAL;
- if (viewport)
+ if (viewport != nullptr)
{
- if (settings.cameraMode)
+ if (settings.cameraMode != 0u)
viewport->toggleCameraMode();
Map *const map = viewport->getMap();
- if (map)
+ if (map != nullptr)
map->setDrawLayersFlags(MapType::NORMAL);
}
settings.imitationMode = config.resetIntValue("imitationMode");