From 043fb83d8febc9d277064d5b24e60832375a110f Mon Sep 17 00:00:00 2001 From: GeckoEidechse <40122905+GeckoEidechse@users.noreply.github.com> Date: Sun, 2 Jul 2023 15:54:01 +0200 Subject: Improve `ShouldLoadNorthstar()` logic readability (#499) --- NorthstarLauncher/main.cpp | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/NorthstarLauncher/main.cpp b/NorthstarLauncher/main.cpp index dd3b68f5..9f641036 100644 --- a/NorthstarLauncher/main.cpp +++ b/NorthstarLauncher/main.cpp @@ -254,13 +254,9 @@ void PrependPath() bool ShouldLoadNorthstar(int argc, char* argv[]) { - bool loadNorthstar = true; for (int i = 0; i < argc; i++) if (!strcmp(argv[i], "-vanilla")) - loadNorthstar = false; - - if (!loadNorthstar) - return loadNorthstar; + return false; auto runNorthstarFile = std::ifstream("run_northstar.txt"); if (runNorthstarFile) @@ -269,9 +265,9 @@ bool ShouldLoadNorthstar(int argc, char* argv[]) runNorthstarFileBuffer << runNorthstarFile.rdbuf(); runNorthstarFile.close(); if (runNorthstarFileBuffer.str().starts_with("0")) - loadNorthstar = false; + return false; } - return loadNorthstar; + return true; } bool LoadNorthstar() -- cgit v1.2.3