mirror of
https://github.com/JezuzLizard/T4SP-Server-Plugin.git
synced 2025-06-25 22:01:49 +00:00
Fixed up the builtin
This commit is contained in:
@ -36,7 +36,7 @@ namespace fileio
|
||||
{
|
||||
if (fpath.empty())
|
||||
{
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
constexpr static std::array bad_strings { R"(..)", R"(../)", R"(..\)" };
|
||||
@ -404,7 +404,8 @@ namespace fileio
|
||||
|
||||
gsc::function::add("fs_listfiles", []()
|
||||
{
|
||||
auto fpath = build_base_path(game::Scr_GetString(0, game::SCRIPTINSTANCE_SERVER));
|
||||
std::string dir = game::Scr_GetString(0, game::SCRIPTINSTANCE_SERVER);
|
||||
auto fpath = build_base_path(dir);
|
||||
|
||||
int numfiles;
|
||||
auto* files = game::FS_ListFiles(fpath.c_str(), "", game::FS_LIST_ALL, &numfiles);
|
||||
@ -412,7 +413,7 @@ namespace fileio
|
||||
game::Scr_MakeArray(game::SCRIPTINSTANCE_SERVER);
|
||||
for (int i = 0; i < numfiles; i++)
|
||||
{
|
||||
game::Scr_AddString(game::SCRIPTINSTANCE_SERVER, files[i]);
|
||||
game::Scr_AddString(game::SCRIPTINSTANCE_SERVER, (dir + "/" + files[i]).c_str());
|
||||
game::Scr_AddArray(game::SCRIPTINSTANCE_SERVER);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user