From aa5cd3e6825f50e574804455e6b5a3fbe2070062 Mon Sep 17 00:00:00 2001 From: Matthew Hoops Date: Sat, 4 Sep 2010 21:43:16 +0000 Subject: 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 --- engines/mohawk/riven.cpp | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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(); -- cgit v1.2.3