From 564b68a9fc85ed5d7ec6c374a0bc604051744e5a Mon Sep 17 00:00:00 2001 From: Martin Kiewitz Date: Fri, 16 Jul 2010 19:33:28 +0000 Subject: SCI: adding fixme and error() to fix crash when trying to run unmodified gk2 svn-id: r50939 --- engines/sci/resource.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index 2958ca1e3b..1a40cba97e 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -1396,7 +1396,13 @@ int ResourceManager::readResourceMapSCI1(ResourceSource *map) { // for SCI2.1 and SCI3 maps that are not resmap.000. The resmap.* files' numbers // need to be used in concurrence with the volume specified in the map to get // the actual resource file. - addResource(resId, findVolume(map, volume_nr + map->_volumeNumber), off); + int mapVolumeNr = volume_nr + map->_volumeNumber; + ResourceSource *source = findVolume(map, mapVolumeNr); + // FIXME: this code has serious issues with multiple RESMAP.* files (like in unmodified gk2) + // adding a resource with source == NULL would crash later on + if (!source) + error("Unable to find volume for map %s volumeNr %d", map->getLocationName().c_str(), mapVolumeNr); + addResource(resId, source, off); } } } -- cgit v1.2.3