diff options
author | Kari Salminen | 2008-08-06 20:47:59 +0000 |
---|---|---|
committer | Kari Salminen | 2008-08-06 20:47:59 +0000 |
commit | 66fc0d6a2579bf8346ccb91cce37fe517938156f (patch) | |
tree | 56e6a48c99315aaa2412befd2d8ce4de0d47ecaa | |
parent | a944497d7586dfb7adb6246667b4625b988a7542 (diff) | |
download | scummvm-rg350-66fc0d6a2579bf8346ccb91cce37fe517938156f.tar.gz scummvm-rg350-66fc0d6a2579bf8346ccb91cce37fe517938156f.tar.bz2 scummvm-rg350-66fc0d6a2579bf8346ccb91cce37fe517938156f.zip |
Add 320x200 screen bounds checking to Operation Stealth's checkCollision function.
Fixes teleporting bug when getting out of the water after first arcade sequence.
The player previously got teleported to the beach near the hotel. Now it doesn't happen.
The player is still caught motionless and can't move after this fix though...
svn-id: r33668
-rw-r--r-- | engines/cine/script_fw.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/engines/cine/script_fw.cpp b/engines/cine/script_fw.cpp index e761a0c8e4..c6f5f73cf1 100644 --- a/engines/cine/script_fw.cpp +++ b/engines/cine/script_fw.cpp @@ -1789,6 +1789,13 @@ int16 checkCollision(int16 objIdx, int16 x, int16 y, int16 numZones, int16 zoneI int16 result = 0; for (int16 i = 0; i < numZones; i++) { + // Don't try to read data in Operation Stealth if position isn't in 320x200 screen bounds. + if (g_cine->getGameType() == Cine::GType_OS) { + if ((lx + i) < 0 || (lx + i) > 319 || ly < 0 || ly > 199) { + continue; + } + } + idx = getZoneFromPositionRaw(page3Raw, lx + i, ly, 320); assert(idx >= 0 && idx < NUM_MAX_ZONE); |