From 871df7fb57d18ec72e787cf3cbb9c719a386eaee Mon Sep 17 00:00:00 2001 From: Max Horn Date: Thu, 22 May 2003 15:27:44 +0000 Subject: 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 --- scumm/script_v2.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'scumm/script_v2.cpp') 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); } -- cgit v1.2.3