aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorMatthew Hoops2010-09-04 21:43:16 +0000
committerMatthew Hoops2010-09-04 21:43:16 +0000
commitaa5cd3e6825f50e574804455e6b5a3fbe2070062 (patch)
treeea1007c1e5aa1d6859a3c43fbf8b206f61cccd10 /engines
parente55c928075c7ad53d478f0dfca0a4e7bbffb27ff (diff)
downloadscummvm-rg350-aa5cd3e6825f50e574804455e6b5a3fbe2070062.tar.gz
scummvm-rg350-aa5cd3e6825f50e574804455e6b5a3fbe2070062.tar.bz2
scummvm-rg350-aa5cd3e6825f50e574804455e6b5a3fbe2070062.zip
MOHAWK: Ignore invalid Riven hotspots again
There is at least one example of a bad hotspot in Riven (tspit 371 (377 in the DVD version), hotspot 4). This particular hotspot is a zip hotspot which looks like it has its left and right coordinates reversed. However, the zip hotspot would only take the player to the same card as the non zip hotspot so it seems they removed this hotspot with a hack. This fixes a regression from r52487. svn-id: r52532
Diffstat (limited to 'engines')
-rw-r--r--engines/mohawk/riven.cpp11
1 files changed, 10 insertions, 1 deletions
diff --git a/engines/mohawk/riven.cpp b/engines/mohawk/riven.cpp
index 47ea728a53..d79f017c32 100644
--- a/engines/mohawk/riven.cpp
+++ b/engines/mohawk/riven.cpp
@@ -385,7 +385,7 @@ void MohawkEngine_Riven::loadHotspots(uint16 id) {
// NOTE: The hotspot scripts are cleared by the RivenScriptManager automatically.
- Common::SeekableReadStream* inStream = getRawData(ID_HSPT, id);
+ Common::SeekableReadStream *inStream = getRawData(ID_HSPT, id);
_hotspotCount = inStream->readUint16BE();
_hotspots = new RivenHotspot[_hotspotCount];
@@ -401,6 +401,15 @@ void MohawkEngine_Riven::loadHotspots(uint16 id) {
int16 right = inStream->readSint16BE();
int16 bottom = inStream->readSint16BE();
+ // Riven has some invalid rects, disable them here
+ // Known weird hotspots:
+ // - tspit 371 (DVD: 377), hotspot 4
+ if (left >= right || top >= bottom) {
+ warning("%s %d hotspot %d is invalid: (%d, %d, %d, %d)", getStackName(_curStack).c_str(), _curCard, i, left, top, right, bottom);
+ left = top = right = bottom = 0;
+ _hotspots[i].enabled = 0;
+ }
+
_hotspots[i].rect = Common::Rect(left, top, right, bottom);
_hotspots[i].u0 = inStream->readUint16BE();