mirror of
https://github.com/libretro/scummvm.git
synced 2025-02-26 14:27:14 +00:00
SWORD25: Fix running with non-extracted files
After loading or saving a game, the engine believed it was running with extracted files, when then cause a crash when looking for files in the PackageManager. This fixes bug #12173
This commit is contained in:
parent
3e814bcf09
commit
e0d3b05730
@ -156,9 +156,6 @@ bool PackageManager::loadDirectoryAsPackage(const Common::String &directoryName,
|
||||
|
||||
_archiveList.push_front(new ArchiveEntry(folderArchive, mountPosition));
|
||||
|
||||
_extractedFiles = true;
|
||||
_directoryName = directoryName;
|
||||
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
@ -104,6 +104,15 @@ public:
|
||||
FT_FILE = (1 << 1)
|
||||
};
|
||||
|
||||
/**
|
||||
*
|
||||
* Set the PackageManager to run on extracted game files.s
|
||||
*/
|
||||
void setRunWithExtractedFiles(const Common::String &directoryName) {
|
||||
_extractedFiles = true;
|
||||
_directoryName = directoryName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Mounts the contents of a package in the directory specified in the directory tree.
|
||||
* @param FileName The filename of the package to mount
|
||||
|
@ -109,7 +109,9 @@ Common::Error Sword25Engine::appStart() {
|
||||
// Load packages
|
||||
PackageManager *packageManagerPtr = Kernel::getInstance()->getPackage();
|
||||
if (getGameFlags() & GF_EXTRACTED) {
|
||||
if (!packageManagerPtr->loadDirectoryAsPackage(ConfMan.get("path"), "/"))
|
||||
Common::String gameDirectory = ConfMan.get("path");
|
||||
packageManagerPtr->setRunWithExtractedFiles(gameDirectory);
|
||||
if (!packageManagerPtr->loadDirectoryAsPackage(gameDirectory, "/"))
|
||||
return Common::kUnknownError;
|
||||
} else {
|
||||
if (!loadPackages())
|
||||
|
Loading…
x
Reference in New Issue
Block a user