From ec587fc37e31193bb0658a3b3110cb5c5311b058 Mon Sep 17 00:00:00 2001 From: Misa Date: Mon, 15 May 2023 18:12:28 -0700 Subject: [PATCH] Remove bogus warning if CLI playtesting zip level If you used command-line playtesting to load a level in a zip, the game would print a warning saying the level wasn't found. This is because the warning is printed when it tries to load a level before it loads zips, inside the metadata load function itself. To fix this, just move the responsibility for printing the error outside the function, and put it on the caller. --- desktop_version/src/CustomLevels.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/CustomLevels.cpp b/desktop_version/src/CustomLevels.cpp index a6943e81..e92d1522 100644 --- a/desktop_version/src/CustomLevels.cpp +++ b/desktop_version/src/CustomLevels.cpp @@ -258,6 +258,10 @@ static void levelMetaDataCallback(const char* filename) { cl.ListOfMetaData.push_back(temp); } + else + { + vlog_warn("Level %s not found :(", filename_.c_str()); + } } void customlevelclass::getDirectoryData(void) @@ -290,7 +294,6 @@ bool customlevelclass::getLevelMetaDataAndPlaytestArgs(const std::string& _path, if (uMem == NULL) { - vlog_warn("Level %s not found :(", _path.c_str()); return false; }