From: Côme Chilliet Date: Fri, 25 Nov 2016 13:48:53 +0000 (+0800) Subject: Avoid using bool as int X-Git-Url: https://git.jsancho.org/?a=commitdiff_plain;h=250a16d5fa14b462b44b1e698372164ac33aa721;p=lugaru.git Avoid using bool as int --- diff --git a/Source/GameTick.cpp b/Source/GameTick.cpp index 4da057e..4ff1250 100644 --- a/Source/GameTick.cpp +++ b/Source/GameTick.cpp @@ -2055,7 +2055,7 @@ void doDebugKeys() } if (Input::isKeyPressed(SDL_SCANCODE_C)) { - cameramode = 1 - cameramode; + cameramode = !cameramode; } if (Input::isKeyPressed(SDL_SCANCODE_X) && !Input::isKeyDown(SDL_SCANCODE_LSHIFT)) { @@ -2386,7 +2386,7 @@ void doDebugKeys() } if (Input::isKeyPressed(SDL_SCANCODE_M) && Input::isKeyDown(SDL_SCANCODE_LSHIFT)) { - editorenabled = 1 - editorenabled; + editorenabled = !editorenabled; if (editorenabled) { Person::players[0]->damagetolerance = 100000; } else { @@ -5525,7 +5525,7 @@ void MenuTick() displayblinkdelay -= multiplier; if (displayblinkdelay <= 0) { displayblinkdelay = .3; - displayblink = 1 - displayblink; + displayblink = !displayblink; } } @@ -5684,7 +5684,7 @@ void Game::Tick() //keys if (Input::isKeyPressed(SDL_SCANCODE_V) && debugmode) { - freeze = 1 - freeze; + freeze = !freeze; if (freeze) { OPENAL_SetFrequency(OPENAL_ALL, 0.001); } @@ -5718,7 +5718,7 @@ void Game::Tick() consoleblinkdelay -= multiplier; if (consoleblinkdelay <= 0) { consoleblinkdelay = .3; - consoleblink = 1 - consoleblink; + consoleblink = !consoleblink; } }