TOLTECS: Fix script bug #3599964 - "TOLTECS: Crash when entering cave"

This commit is contained in:
Filippos Karapetis 2013-01-08 23:07:22 +02:00
parent a7b72d0a9a
commit 796867cd32

View file

@ -252,9 +252,12 @@ void ScriptInterpreter::execOpcode(byte opcode) {
// ok
_subCode = _code;
byte length = readByte();
if (length == 0) {
warning("Possible script bug detected - opcode length is 0 when calling script function");
return;
}
debug(2, "length = %d", length);
uint16 index = readInt16();
debug(2, "callScriptFunction %d", index);
execScriptFunction(index);
_code += length - 2;
break;