From c3750e3b34ff0bebbd014b55431c7f694f5f8e67 Mon Sep 17 00:00:00 2001 From: Misa Date: Wed, 3 Aug 2022 17:30:23 -0700 Subject: [PATCH] Fix `special/stdin.vvvvvv` being saved to `levelstats.vvv` While fixing #885, I noticed that I had a bunch of `special/stdin.vvvvvv` entries saved in my `levelstats.vvv`. At once I knew that the dumb `special/stdin` hack that actually checks if the filename passed is `special/stdin` was to blame. STDIN playtesting was first merged, I knew in the back of my mind that it was a bit of a dumb hack, but I didn't know it would cause consequences like showing up in `levelstats.vvv`. For now, I'll just have to patch it, but hopefully in the future I'll remove the dumb hack entirely. Commenting both instances of the dumb hack with instructions to grep for it should help maintainers out. --- desktop_version/src/FileSystemUtils.cpp | 2 ++ desktop_version/src/Game.cpp | 5 ++++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/FileSystemUtils.cpp b/desktop_version/src/FileSystemUtils.cpp index ab516972..cf1bbff7 100644 --- a/desktop_version/src/FileSystemUtils.cpp +++ b/desktop_version/src/FileSystemUtils.cpp @@ -571,6 +571,8 @@ void FILESYSTEM_loadFileToMemory( goto fail; } + /* FIXME: Dumb hack to use `special/stdin.vvvvvv` here... + * This is also checked elsewhere... grep for `special/stdin`! */ if (SDL_strcmp(name, "levels/special/stdin.vvvvvv") == 0) { // this isn't *technically* necessary when piping directly from a file, but checking for that is annoying diff --git a/desktop_version/src/Game.cpp b/desktop_version/src/Game.cpp index 54fba70a..d9a9dd9d 100644 --- a/desktop_version/src/Game.cpp +++ b/desktop_version/src/Game.cpp @@ -1965,7 +1965,10 @@ void Game::updatestate(void) case 1015: #if !defined(NO_CUSTOM_LEVELS) //Update level stats - if(cl.numcrewmates()-crewmates()==0) + /* FIXME: Have to add check to not save stats for the dumb hack + * `special/stdin.vvvvvv` filename... see elsewhere, grep for + * `special/stdin`! */ + if(cl.numcrewmates()-crewmates()==0 && customlevelfilename != "levels/special/stdin.vvvvvv") { //Finished level if (trinkets() >= cl.numtrinkets())