From 34195238bb6cc3ff1051230c4acbe3669f082e0e Mon Sep 17 00:00:00 2001 From: Filippos Karapetis Date: Sat, 4 Sep 2010 15:38:24 +0000 Subject: 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 --- engines/sci/engine/script.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'engines/sci') 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; -- cgit v1.2.3