Skip to content

Commit

Permalink
ZVISION: Error out when a script file can't be found or be parsed
Browse files Browse the repository at this point in the history
This should be an error, as we've effectively reached a non-existing
scene (such as in bug #6780), or we haven't parsed script files of a
scene fully, thus unexpected behavior will likely occur
  • Loading branch information
bluegr committed Jan 23, 2015
1 parent 1bd83a9 commit d75fbe7
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions engines/zvision/scripting/scr_file_handling.cpp
Expand Up @@ -47,15 +47,13 @@ namespace ZVision {
void ScriptManager::parseScrFile(const Common::String &fileName, ScriptScope &scope) {
Common::File file;
if (!_engine->getSearchManager()->openFile(file, fileName)) {
warning("Script file not found: %s", fileName.c_str());
return;
error("Script file not found: %s", fileName.c_str());
}

while (!file.eos()) {
Common::String line = file.readLine();
if (file.err()) {
warning("Error parsing scr file: %s", fileName.c_str());
return;
error("Error parsing scr file: %s", fileName.c_str());
}

trimCommentsAndWhiteSpace(&line);
Expand Down

0 comments on commit d75fbe7

Please sign in to comment.