diff options
author | James Brown | 2003-01-15 16:23:04 +0000 |
---|---|---|
committer | James Brown | 2003-01-15 16:23:04 +0000 |
commit | ec006a4357a7aec841164ed1207f38cd03f540b1 (patch) | |
tree | 26d0c9f80ca2911dd4914bb12d5d2d97c7b2d344 | |
parent | 631f0e5d4b698f18ade5213481281498b06ab732 (diff) | |
download | scummvm-rg350-ec006a4357a7aec841164ed1207f38cd03f540b1.tar.gz scummvm-rg350-ec006a4357a7aec841164ed1207f38cd03f540b1.tar.bz2 scummvm-rg350-ec006a4357a7aec841164ed1207f38cd03f540b1.zip |
localvar fix take 2. Note that ship-to-ship combat is still impossible (cannons dont work), but at least it doesnt crash now - you
can use the cheat (shift-v i think)
svn-id: r6471
-rw-r--r-- | scumm/saveload.cpp | 2 | ||||
-rw-r--r-- | scumm/script_v8.cpp | 4 | ||||
-rw-r--r-- | scumm/scumm.h | 2 |
3 files changed, 4 insertions, 4 deletions
diff --git a/scumm/saveload.cpp b/scumm/saveload.cpp index 95c8c457ea..67230f64b7 100644 --- a/scumm/saveload.cpp +++ b/scumm/saveload.cpp @@ -361,7 +361,7 @@ void Scumm::saveOrLoad(Serializer *s, uint32 savegameVersion) // 16 to 32 bit variables... and THEN from 16 to 20 variables MKARRAY_OLD(Scumm, vm.localvar[0][0], sleUint16, 25 * 17, VER_V8, VER_V8), MKARRAY_OLD(Scumm, vm.localvar[0][0], sleUint16, NUM_SCRIPT_SLOT * 17, VER_V9, VER_V14), - MKARRAY(Scumm, vm.localvar[0][0], sleUint16, NUM_SCRIPT_SLOT * 20, VER_V15), + MKARRAY(Scumm, vm.localvar[0][0], sleUint16, NUM_SCRIPT_SLOT * 25, VER_V15), MKARRAY(Scumm, _resourceMapper[0], sleByte, 128, VER_V8), MKARRAY(Scumm, _charsetColorMap[0], sleByte, 16, VER_V8), diff --git a/scumm/script_v8.cpp b/scumm/script_v8.cpp index cf6822cd86..6582948a21 100644 --- a/scumm/script_v8.cpp +++ b/scumm/script_v8.cpp @@ -410,7 +410,7 @@ int Scumm_v8::readVar(uint var) if (var & 0x40000000) { var &= 0xFFFFFFF; - checkRange(0x10, 0, var, "Local variable %d out of range(r)"); + checkRange(25, 0, var, "Local variable %d out of range(r)"); return vm.localvar[_currentScript][var]; } @@ -449,7 +449,7 @@ void Scumm_v8::writeVar(uint var, int value) if (var & 0x40000000) { var &= 0xFFFFFFF; - checkRange(0x10, 0, var, "Local variable %d out of range(w)"); + checkRange(25, 0, var, "Local variable %d out of range(w)"); vm.localvar[_currentScript][var] = value; return; } diff --git a/scumm/scumm.h b/scumm/scumm.h index 8780fe53e3..bbd7dff6c4 100644 --- a/scumm/scumm.h +++ b/scumm/scumm.h @@ -254,7 +254,7 @@ public: byte cutSceneStackPointer; ScriptSlot slot[NUM_SCRIPT_SLOT]; NestedScript nest[15]; - int32 localvar[NUM_SCRIPT_SLOT][21]; + int32 localvar[NUM_SCRIPT_SLOT][26]; } vm; struct { |