From 9d293af17658587c5a39bdc937d57058af00d37d Mon Sep 17 00:00:00 2001 From: Alex Szpakowski Date: Sun, 4 May 2014 04:10:46 -0300 Subject: [PATCH] Fixed love.filesystem.setIdentity breaking if a file has been written to an old identity dir before the new setIdentity call --- src/modules/filesystem/physfs/Filesystem.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/modules/filesystem/physfs/Filesystem.cpp b/src/modules/filesystem/physfs/Filesystem.cpp index 748dbceea..914b28178 100644 --- a/src/modules/filesystem/physfs/Filesystem.cpp +++ b/src/modules/filesystem/physfs/Filesystem.cpp @@ -130,6 +130,11 @@ bool Filesystem::setIdentity(const char *ident, bool appendToPath) // (No error on fail, it means that the path doesn't exist). PHYSFS_addToSearchPath(save_path_full.c_str(), appendToPath); + // HACK: This forces setupWriteDirectory to be called the next time a file + // is opened for writing - otherwise it won't be called at all if it was + // already called at least once before. + PHYSFS_setWriteDir(nullptr); + return true; }