Просмотр исходного кода

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 лет назад
Родитель
Сommit
ce9d0be1ea
1 измененных файлов с 6 добавлено и 0 удалено
  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;
 
 	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 += archive;