From 9e560e31cff50d10c533ef0381648741147dccf3 Mon Sep 17 00:00:00 2001 From: Misa Date: Tue, 6 Apr 2021 14:45:49 -0700 Subject: [PATCH] Blacklist non-.vvvvvv files in level metadata While the game does support playing levels with filenames that don't have the .vvvvvv extension, it doesn't do it well. Namely, those files can't be loaded or saved into the editor (because a .vvvvvv always gets tacked on to your input when saving or loading). In 2.3, this gets worse because you can't load a level without a .vvvvvv extension from command-line playtesting (because a .vvvvvv automatically gets added) and you can't load per-level custom assets. The only place where extensionless level files are supported is when loading level metadata. But this makes it so they no longer work. This is technically an API break, but it's easily fixed (just add the .vvvvvv), plus there's nothing to be gained from not having an extension, plus basically no one ever actually did this in the first place (as far as I know, I am the only person to have ever done this, and no one else ever has). --- desktop_version/src/editor.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/desktop_version/src/editor.cpp b/desktop_version/src/editor.cpp index b0475cad..c0608039 100644 --- a/desktop_version/src/editor.cpp +++ b/desktop_version/src/editor.cpp @@ -212,7 +212,9 @@ static void levelMetaDataCallback(const char* filename) LevelMetaData temp; std::string filename_ = filename; - if (!FILESYSTEM_isFile(filename) || FILESYSTEM_isMounted(filename)) + if (!endsWith(filename, ".vvvvvv") + || !FILESYSTEM_isFile(filename) + || FILESYSTEM_isMounted(filename)) { return; }