diff options
author | Max Horn | 2003-01-09 22:53:21 +0000 |
---|---|---|
committer | Max Horn | 2003-01-09 22:53:21 +0000 |
commit | c3657ff6373269260ae487ab51d977a481971acd (patch) | |
tree | a184abe68a9ac9a43e22fcc698299262d2ae88ca /scumm/script_v8.cpp | |
parent | 86dea678e2759566110b1b6520363e888086c66b (diff) | |
download | scummvm-rg350-c3657ff6373269260ae487ab51d977a481971acd.tar.gz scummvm-rg350-c3657ff6373269260ae487ab51d977a481971acd.tar.bz2 scummvm-rg350-c3657ff6373269260ae487ab51d977a481971acd.zip |
fixed the 'too many verbs' bug: verbid is 16 bits but was stored in save games as a byte. This means that existing savegames are still affected by the bug
svn-id: r6376
Diffstat (limited to 'scumm/script_v8.cpp')
-rw-r--r-- | scumm/script_v8.cpp | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index 043e5dbcce..ca02abb4b9 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -37,7 +37,6 @@ void Scumm_v8::setupOpcodes() { - // TODO: any of the o6_ entries are potentially wrong and pure guesses :-) static const OpcodeEntryV8 opcodes[256] = { /* 00 */ OPCODE(o6_invalid), @@ -1154,16 +1153,21 @@ void Scumm_v8::o8_verbOps() _verbRedraw = true; - if (0 <= _curVerbSlot && _curVerbSlot < _maxVerbs) - vs = &_verbs[_curVerbSlot]; - if (subOp != 0x96) - assert(vs); - - switch (subOp) { - case 0x96: // SO_VERB_INIT Choose verb number for editing + if (subOp == 0x96) { _curVerb = pop(); _curVerbSlot = getVerbSlot(_curVerb, 0); checkRange(_maxVerbs - 1, 0, _curVerbSlot, "Illegal new verb slot %d"); + //printf("Setting current actor to %d\n", _curActor); + return; + } + + assert(0 <= _curVerbSlot && _curVerbSlot < _maxVerbs); + vs = &_verbs[_curVerbSlot]; + assert(vs); + + switch (subOp) { + case 0x96: // SO_VERB_INIT Choose verb number for editing + // handled above! break; case 0x97: // SO_VERB_NEW New verb if (_curVerbSlot == 0) { @@ -1171,9 +1175,8 @@ void Scumm_v8::o8_verbOps() if (_verbs[slot].verbid == 0) break; } - if (slot == _maxVerbs) { - warning("Too many verbs"); - break; + if (slot >= _maxVerbs) { + error("Too many verbs"); } _curVerbSlot = slot; } |