aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-05-08 13:05:31 +0000
committerTorbjörn Andersson2005-05-08 13:05:31 +0000
commit781472641e32d1999660caa54c27b218c5b4298d (patch)
tree53f17d7b2af22e6cfa94e9cb71ebac8c1ac1e896
parente39dea37e7cdb4ec5e5828549231a69639e9581e (diff)
downloadscummvm-rg350-781472641e32d1999660caa54c27b218c5b4298d.tar.gz
scummvm-rg350-781472641e32d1999660caa54c27b218c5b4298d.tar.bz2
scummvm-rg350-781472641e32d1999660caa54c27b218c5b4298d.zip
Made it possible to quit while the game is asking for a CD.
svn-id: r17963
-rw-r--r--sword2/resman.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/sword2/resman.cpp b/sword2/resman.cpp
index c417676918..417d8fe394 100644
--- a/sword2/resman.cpp
+++ b/sword2/resman.cpp
@@ -20,6 +20,7 @@
#include "common/stdafx.h"
#include "common/file.h"
+#include "common/system.h"
#include "sword2/sword2.h"
#include "sword2/defs.h"
#include "sword2/console.h"
@@ -565,6 +566,13 @@ void ResourceManager::addToCacheList(Resource *res) {
File *ResourceManager::openCluFile(uint16 fileNum) {
File *file = new File;
while (!file->open(_resFiles[fileNum].fileName)) {
+ // HACK: We have to check for this, or it'll be impossible to
+ // quit while the game is asking for the user to insert a CD.
+ // But recovering from this situation gracefully is just too
+ // much trouble, so quit now.
+ if (_vm->_quit)
+ g_system->quit();
+
// If the file is supposed to be on hard disk, or we're
// playing a demo, then we're in trouble if the file
// can't be found!