Browse Source

Fixed love.filesystem.mount to consistently fail to mount things which are inside the game source directory, instead of only failing when the source dir is a zipped .love

Alex Szpakowski 12 years ago
parent
commit
ce9d0be1ea
1 changed files with 6 additions and 0 deletions
  1. 6 0
      src/modules/filesystem/physfs/Filesystem.cpp

+ 6 - 0
src/modules/filesystem/physfs/Filesystem.cpp

@@ -196,6 +196,12 @@ bool Filesystem::mount(const char *archive, const char *mountpoint)
 		return false;
 		return false;
 
 
 	std::string realPath(realDir);
 	std::string realPath(realDir);
+
+	// Always disallow mounting of files inside the game source, since it won't
+	// work anyway if the game source is a zipped .love file.
+	if (realPath.find(game_source) == 0)
+		return false;
+
 	realPath += LOVE_PATH_SEPARATOR;
 	realPath += LOVE_PATH_SEPARATOR;
 	realPath += archive;
 	realPath += archive;