diff options
author | Max Horn | 2003-05-22 15:27:44 +0000 |
---|---|---|
committer | Max Horn | 2003-05-22 15:27:44 +0000 |
commit | 871df7fb57d18ec72e787cf3cbb9c719a386eaee (patch) | |
tree | 264a5c57005ca8d454917e71dcaa15317b107ee9 /scumm/script_v2.cpp | |
parent | a6c8b58045e4f2de019fcadc951a344b5b2c5a99 (diff) | |
download | scummvm-rg350-871df7fb57d18ec72e787cf3cbb9c719a386eaee.tar.gz scummvm-rg350-871df7fb57d18ec72e787cf3cbb9c719a386eaee.tar.bz2 scummvm-rg350-871df7fb57d18ec72e787cf3cbb9c719a386eaee.zip |
restricted getObjectIndex to only search thru _objs, not _inventory(to avoid future confusion), this might cause regressions, though; fixed o2_getObjPreposition; adapted some code to the changed getObjectIndex
svn-id: r7829
Diffstat (limited to 'scumm/script_v2.cpp')
-rw-r--r-- | scumm/script_v2.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/scumm/script_v2.cpp b/scumm/script_v2.cpp index 1fdcc2bd92..632a3c2ffe 100644 --- a/scumm/script_v2.cpp +++ b/scumm/script_v2.cpp @@ -517,8 +517,10 @@ void Scumm_v2::o2_setObjPreposition() { int unk = fetchScriptByte(); if (whereIsObject(obj) != WIO_NOT_FOUND) { - ObjectData *od = &_objs[getObjectIndex(obj)]; - od->walk_y = (unk << 5) | (od->walk_y & 0x1F); + // FIXME: this might not work properly the moment we save and restore the game. + byte *ptr = getOBCDFromObject(obj) + 12; + *ptr &= 0x1F; + *ptr |= unk << 5; } } @@ -527,8 +529,8 @@ void Scumm_v2::o2_getObjPreposition() { int obj = getVarOrDirectWord(0x80); if (whereIsObject(obj) != WIO_NOT_FOUND) { - ObjectData *od = &_objs[getObjectIndex(obj)]; - setResult(od->walk_y >> 5); + byte *ptr = getOBCDFromObject(obj) + 12; + setResult(*ptr >> 5); } else { setResult(0xFF); } |