diff options
author | Filippos Karapetis | 2010-09-04 15:38:24 +0000 |
---|---|---|
committer | Filippos Karapetis | 2010-09-04 15:38:24 +0000 |
commit | 34195238bb6cc3ff1051230c4acbe3669f082e0e (patch) | |
tree | 37ff121dc1f1306008acf975fb5fb241d3681bf2 /engines/sci | |
parent | 8a93da0516c5d35bc2581fe50602dd53fc101d70 (diff) | |
download | scummvm-rg350-34195238bb6cc3ff1051230c4acbe3669f082e0e.tar.gz scummvm-rg350-34195238bb6cc3ff1051230c4acbe3669f082e0e.tar.bz2 scummvm-rg350-34195238bb6cc3ff1051230c4acbe3669f082e0e.zip |
SCI: Don't try to initialize non-existent scripts, error out instead
(Invalid scripts may be requested to be loaded when warping to an incorrect room)
svn-id: r52524
Diffstat (limited to 'engines/sci')
-rw-r--r-- | engines/sci/engine/script.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/engines/sci/engine/script.cpp b/engines/sci/engine/script.cpp index ccf04f294a..27618478b3 100644 --- a/engines/sci/engine/script.cpp +++ b/engines/sci/engine/script.cpp @@ -69,6 +69,9 @@ void Script::freeScript() { void Script::init(int script_nr, ResourceManager *resMan) { Resource *script = resMan->findResource(ResourceId(kResourceTypeScript, script_nr), 0); + if (!script) + error("Script %d not found\n", script_nr); + _localsOffset = 0; _localsBlock = NULL; _localsCount = 0; |