1
0
mirror of https://github.com/OpenRCT2/OpenRCT2 synced 2026-01-15 19:13:07 +01:00

Fix #7911: Unable to save new scenarios (#7914)

The problem was that the filters have changed so they included the '*' character. This got appended to the path, which caused the check for valid filenames to fail.

This commit reverts the offending strings and code lines to how it was before.
This commit is contained in:
Hielke Morsink
2018-08-19 19:49:49 +02:00
committed by GitHub
parent ea8bab9897
commit 3e2f8148c5

View File

@@ -216,19 +216,19 @@ static const char* getFilterPatternByType(const int32_t type, const bool isSave)
switch (type & 0x0E)
{
case LOADSAVETYPE_GAME:
return isSave ? "*.sv6" : "*.sv6;*.sc6;*.sc4;*.sv4;*.sv7";
return isSave ? ".sv6" : ".sv6;.sc6;.sc4;.sv4;.sv7";
case LOADSAVETYPE_LANDSCAPE:
return isSave ? "*.sc6" : "*.sc6;*.sv6;*.sc4;*.sv4;*.sv7";
return isSave ? ".sc6" : ".sc6;.sv6;.sc4;.sv4;.sv7";
case LOADSAVETYPE_SCENARIO:
return "*.sc6";
return ".sc6";
case LOADSAVETYPE_TRACK:
return isSave ? "*.td6" : "*.td6;*.td4";
return isSave ? ".td6" : ".td6;.td4";
case LOADSAVETYPE_HEIGHTMAP:
return "*.bmp;*.png";
return ".bmp;.png";
default:
openrct2_assert(true, "Unsupported load/save directory type.");
@@ -907,7 +907,8 @@ static void window_loadsave_populate_list(rct_window* w, int32_t includeNewItem,
while (extToken != nullptr)
{
safe_strcpy(filter, directory, Util::CountOf(filter));
safe_strcat_path(filter, extToken, Util::CountOf(filter));
safe_strcat_path(filter, "*", Util::CountOf(filter));
path_append_extension(filter, extToken, Util::CountOf(filter));
auto scanner = std::unique_ptr<IFileScanner>(Path::ScanDirectory(filter, false));
while (scanner->Next())