From 5331f23495d3cfec25e78eb1a99e93c9d441df76 Mon Sep 17 00:00:00 2001 From: Diavolo Date: Fri, 6 Jan 2023 14:09:17 +0100 Subject: [PATCH] [Download]: Fix listing of files --- src/Components/Modules/Download.cpp | 6 +----- src/Utils/IO.hpp | 4 ++-- 2 files changed, 3 insertions(+), 7 deletions(-) diff --git a/src/Components/Modules/Download.cpp b/src/Components/Modules/Download.cpp index 6d66c7b7..4b70a727 100644 --- a/src/Components/Modules/Download.cpp +++ b/src/Components/Modules/Download.cpp @@ -466,16 +466,12 @@ namespace Components std::vector fileList; const auto path = (*Game::fs_basepath)->current.string / fsGame; - auto list = Utils::IO::ListFiles(path, false); + auto list = FileSystem::GetSysFileList(path.generic_string(), "iwd", false); list.emplace_back("mod.ff"); for (const auto& file : list) { auto filename = path / file; - if (filename.extension() != ".iwd"s) // We don't want to serve other files - { - continue; - } if (file.find("_svr_") != std::string::npos) // Files that are 'server only' are skipped { diff --git a/src/Utils/IO.hpp b/src/Utils/IO.hpp index ae68a5ce..c4e73825 100644 --- a/src/Utils/IO.hpp +++ b/src/Utils/IO.hpp @@ -9,7 +9,7 @@ namespace Utils::IO bool RemoveFile(const std::string& file); std::size_t FileSize(const std::string& file); bool CreateDir(const std::string& dir); - bool DirectoryExists(const std::filesystem::path& file); - bool DirectoryIsEmpty(const std::filesystem::path& file); + bool DirectoryExists(const std::filesystem::path& directory); + bool DirectoryIsEmpty(const std::filesystem::path& directory); std::vector ListFiles(const std::filesystem::path& directory, bool recursive = false); }