[Filesystem] Fix macro

This commit is contained in:
Diavolo 2022-08-11 12:44:03 +02:00
parent 7b1b135e3f
commit b8d4ff6e26
No known key found for this signature in database
GPG Key ID: FA77F074E98D98A5
4 changed files with 7 additions and 7 deletions

View File

@ -202,7 +202,7 @@ namespace Components
return fileList; return fileList;
} }
bool FileSystem::DeleteFile(const std::string& folder, const std::string& file) bool FileSystem::_DeleteFile(const std::string& folder, const std::string& file)
{ {
char path[MAX_PATH] = { 0 }; char path[MAX_PATH] = { 0 };
Game::FS_BuildPathToFile(Dvar::Var("fs_basepath").get<const char*>(), reinterpret_cast<char*>(0x63D0BB8), Utils::String::VA("%s/%s", folder.data(), file.data()), reinterpret_cast<char**>(&path)); Game::FS_BuildPathToFile(Dvar::Var("fs_basepath").get<const char*>(), reinterpret_cast<char*>(0x63D0BB8), Utils::String::VA("%s/%s", folder.data(), file.data()), reinterpret_cast<char**>(&path));

View File

@ -92,7 +92,7 @@ namespace Components
static std::filesystem::path GetAppdataPath(); static std::filesystem::path GetAppdataPath();
static std::vector<std::string> GetFileList(const std::string& path, const std::string& extension); static std::vector<std::string> GetFileList(const std::string& path, const std::string& extension);
static std::vector<std::string> GetSysFileList(const std::string& path, const std::string& extension, bool folders = false); static std::vector<std::string> GetSysFileList(const std::string& path, const std::string& extension, bool folders = false);
static bool DeleteFile(const std::string& folder, const std::string& file); static bool _DeleteFile(const std::string& folder, const std::string& file);
private: private:
static std::mutex Mutex; static std::mutex Mutex;

View File

@ -226,8 +226,8 @@ namespace Components
Logger::Print("Deleting demo {}...\n", info.name); Logger::Print("Deleting demo {}...\n", info.name);
FileSystem::DeleteFile("demos", info.name + ".dm_13"); FileSystem::_DeleteFile("demos", info.name + ".dm_13");
FileSystem::DeleteFile("demos", info.name + ".dm_13.json"); FileSystem::_DeleteFile("demos", info.name + ".dm_13.json");
// Reset our ui_demo_* dvars here, because the theater menu needs it. // Reset our ui_demo_* dvars here, because the theater menu needs it.
Dvar::Var("ui_demo_mapname").set(""); Dvar::Var("ui_demo_mapname").set("");
@ -310,8 +310,8 @@ namespace Components
for (int i = 0; i < numDel; ++i) for (int i = 0; i < numDel; ++i)
{ {
Logger::Print("Deleting old demo {}\n", files[i]); Logger::Print("Deleting old demo {}\n", files[i]);
FileSystem::DeleteFile("demos", files[i].data()); FileSystem::_DeleteFile("demos", files[i].data());
FileSystem::DeleteFile("demos", Utils::String::VA("%s.json", files[i].data())); FileSystem::_DeleteFile("demos", Utils::String::VA("%s.json", files[i].data()));
} }
Command::Execute(Utils::String::VA("record auto_%lld", time(nullptr)), true); Command::Execute(Utils::String::VA("record auto_%lld", time(nullptr)), true);

View File

@ -40,7 +40,7 @@ namespace Components
assert(dvar); assert(dvar);
assert(parsedValue); assert(parsedValue);
Game::Dvar_SetFromStringFromSource(dvar, parsedValue, Game::DvarSetSource::DVAR_SOURCE_INTERNAL); Game::Dvar_SetFromStringFromSource(dvar, parsedValue, Game::DVAR_SOURCE_INTERNAL);
Logger::Print("Overriding '{}' from '{}'\n", dvar->name, filename); Logger::Print("Overriding '{}' from '{}'\n", dvar->name, filename);
// Successfully found and tried to apply the string value to the dvar // Successfully found and tried to apply the string value to the dvar