aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNicola Mettifogo2008-06-04 01:27:55 +0000
committerNicola Mettifogo2008-06-04 01:27:55 +0000
commit52fbdd51eb0f7d31ce1718adfc60bc169c7c84c3 (patch)
tree402b37623d3d8f688cb938aafd61f0b636745ada
parentfe6ab4227e070a6ef6ae5528025c2b2ea9a0b271 (diff)
downloadscummvm-rg350-52fbdd51eb0f7d31ce1718adfc60bc169c7c84c3.tar.gz
scummvm-rg350-52fbdd51eb0f7d31ce1718adfc60bc169c7c84c3.tar.bz2
scummvm-rg350-52fbdd51eb0f7d31ce1718adfc60bc169c7c84c3.zip
Script instructions referencing unexisting animations are now skipped, instead of crashing the engine.
svn-id: r32524
-rw-r--r--engines/parallaction/parser_ns.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/engines/parallaction/parser_ns.cpp b/engines/parallaction/parser_ns.cpp
index 96a4fced71..2c4601c938 100644
--- a/engines/parallaction/parser_ns.cpp
+++ b/engines/parallaction/parser_ns.cpp
@@ -308,8 +308,6 @@ void LocationParser_ns::parseAnimation(AnimationList &list, char *name) {
void ProgramParser_ns::parseInstruction() {
- InstructionPtr inst(new Instruction);
-
_script->readLineToken(true);
if (_tokens[0][1] == '.') {
@@ -322,10 +320,13 @@ void ProgramParser_ns::parseInstruction() {
} else
ctxt.a = _program->_anim;
- ctxt.inst = inst;
+ if (!ctxt.a) {
+ return;
+ }
+ InstructionPtr inst(new Instruction);
+ ctxt.inst = inst;
_parser->parseStatement();
-
_program->_instructions.push_back(inst);
return;