Browse Source

Fixed love.filesystem.setIdentity breaking if a file has been written to an old identity dir before the new setIdentity call

Alex Szpakowski 11 years ago
parent
commit
9d293af176
1 changed files with 5 additions and 0 deletions
  1. 5 0
      src/modules/filesystem/physfs/Filesystem.cpp

+ 5 - 0
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;
 }