diff options
author | Kari Salminen | 2008-06-25 21:57:08 +0000 |
---|---|---|
committer | Kari Salminen | 2008-06-25 21:57:08 +0000 |
commit | 1339a55389efa97e484457a8963b69364a98452d (patch) | |
tree | 7c65a4180aa9e3c5f250537d68ee09ca08364cc7 /engines/cine/script_fw.cpp | |
parent | dee147eebfce779b834b98b81cdad4e76b3fd984 (diff) | |
download | scummvm-rg350-1339a55389efa97e484457a8963b69364a98452d.tar.gz scummvm-rg350-1339a55389efa97e484457a8963b69364a98452d.tar.bz2 scummvm-rg350-1339a55389efa97e484457a8963b69364a98452d.zip |
Implemented support for zoneQuery (Operation Stealth specific).
Fixed opcodes (related to zoneQuery):
- 0x08: o1_checkCollision
- 0x9A: o2_wasZoneChecked
NOTE: Savegame support for the zoneQuery data is broken
svn-id: r32790
Diffstat (limited to 'engines/cine/script_fw.cpp')
-rw-r--r-- | engines/cine/script_fw.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp index 845120c99e..b9dcad9877 100644 --- a/engines/cine/script_fw.cpp +++ b/engines/cine/script_fw.cpp @@ -1764,18 +1764,32 @@ int16 checkCollision(int16 objIdx, int16 x, int16 y, int16 numZones, int16 zoneI int16 lx = objectTable[objIdx].x + x; int16 ly = objectTable[objIdx].y + y; int16 idx; + int16 result = 0; for (int16 i = 0; i < numZones; i++) { idx = getZoneFromPositionRaw(page3Raw, lx + i, ly, 320); - assert(idx >= 0 && idx <= NUM_MAX_ZONE); + assert(idx >= 0 && idx < NUM_MAX_ZONE); + + // The zoneQuery table is updated here only in Operation Stealth + if (g_cine->getGameType() == Cine::GType_OS) { + if (zoneData[idx] >= 0 && zoneData[idx] < NUM_MAX_ZONE) { + zoneQuery[zoneData[idx]]++; + } + } if (zoneData[idx] == zoneIdx) { - return 1; + result = 1; + // Future Wars breaks out early on the first match, but + // Operation Stealth doesn't because it needs to update + // the zoneQuery table for the whole loop's period. + if (g_cine->getGameType() == Cine::GType_FW) { + break; + } } } - return 0; + return result; } uint16 compareVars(int16 a, int16 b) { |