aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFilippos Karapetis2010-05-30 20:01:25 +0000
committerFilippos Karapetis2010-05-30 20:01:25 +0000
commit9c2da78ba9a99145241025974c42219a673dd2a8 (patch)
tree7dc28789b1127954a523a2326f1aaf2d159396d4
parent016862ac3a4928529d9eaedf6edf3e916c89155c (diff)
downloadscummvm-rg350-9c2da78ba9a99145241025974c42219a673dd2a8.tar.gz
scummvm-rg350-9c2da78ba9a99145241025974c42219a673dd2a8.tar.bz2
scummvm-rg350-9c2da78ba9a99145241025974c42219a673dd2a8.zip
kScriptID can be used to load scripts with no exports. Don't throw warnings in this case if no export is requested, as it's perfectly normal behavior
svn-id: r49331
-rw-r--r--engines/sci/engine/kscripts.cpp10
1 files changed, 8 insertions, 2 deletions
diff --git a/engines/sci/engine/kscripts.cpp b/engines/sci/engine/kscripts.cpp
index d5a0c225d6..b829887433 100644
--- a/engines/sci/engine/kscripts.cpp
+++ b/engines/sci/engine/kscripts.cpp
@@ -194,8 +194,14 @@ reg_t kScriptID(EngineState *s, int argc, reg_t *argv) {
Script *scr = s->_segMan->getScript(scriptSeg);
if (!scr->_numExports) {
- // FIXME: Is this fatal? This occurs in SQ4CD
- warning("Script 0x%x does not have a dispatch table", script);
+ // This is normal. Some scripts don't have a dispatch (exports) table,
+ // and this call is probably used to load them in memory, ignoring
+ // the return value. If only one argument is passed, this call is done
+ // only to load the script in memory. Thus, don't show any warning,
+ // as no return value is expected
+ if (argc == 2)
+ warning("Script 0x%x does not have a dispatch table and export %d "
+ "was requested from it", script, index);
return NULL_REG;
}