diff --git a/src/component/fileio.cpp b/src/component/fileio.cpp index f0fb69f..bf1f73c 100644 --- a/src/component/fileio.cpp +++ b/src/component/fileio.cpp @@ -405,6 +405,12 @@ namespace fileio gsc::function::add("fs_listfiles", []() { std::string dir = game::Scr_GetString(0, game::SCRIPTINSTANCE_SERVER); + + if (dir.ends_with("\\") || dir.ends_with("/")) + { + dir = dir.substr(0, dir.length() - 1); + } + auto fpath = build_base_path(dir); int numfiles;