From e4d02feffa0599dda86e4383fbf20b50665536cb Mon Sep 17 00:00:00 2001 From: Ally Date: Wed, 7 Dec 2022 13:32:28 -0400 Subject: [PATCH] Apply suggestions from code review Co-authored-by: Misa Elizabeth Kai --- desktop_version/src/Game.cpp | 9 +++++---- desktop_version/src/Script.cpp | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 67522c49..84908feb 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -717,7 +717,7 @@ void Game::savetele_textbox(void) } } -void Game::setstate(int gamestate) +void Game::setstate(const int gamestate) { if (!statelocked) { @@ -725,7 +725,7 @@ void Game::setstate(int gamestate) } } -void Game::setstate(int gamestate, int delay) +void Game::setstate(const int gamestate, const int delay) { if (!statelocked) { @@ -742,7 +742,7 @@ void Game::incstate() } } -void Game::setstatedelay(int delay) +void Game::setstatedelay(const int delay) { if (!statelocked) { @@ -763,7 +763,8 @@ void Game::unlockstate() void Game::updatestate(void) { statedelay--; - if(statedelay <= 0){ + if (statedelay <= 0) + { statedelay = 0; glitchrunkludge=false; } diff --git a/desktop_version/src/Script.cpp b/desktop_version/src/Script.cpp index b34f4876..bacd4e97 100644 --- a/desktop_version/src/Script.cpp +++ b/desktop_version/src/Script.cpp @@ -1117,7 +1117,7 @@ void scriptclass::run(void) } else if (words[0] == "gamestate") { - // Allow the gamestate command bypass statelock, at least for now + // Allow the gamestate command to bypass statelock, at least for now game.state = ss_toi(words[1]); game.statedelay = 0; }