Skip to content

Commit

Permalink
fix(scummrp): Fix fatal "Duplicate offset in index" error for MONKEY1…
Browse files Browse the repository at this point in the history
…-FLOPPY-VGA

It appears that this version of Monkey Island has CO_0117 as a duplicate
costume for CO_0010.  This would break ScummRp and ScummTr extraction.

As far as I know, the EGA and the CD-ROM versions of Monkey Island 1
don't have this bug.

Issue #18.
  • Loading branch information
dwatteau committed Jan 10, 2021
1 parent 71faa01 commit dc94b2a
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/ScummRp/block.cpp
Expand Up @@ -782,6 +782,18 @@ void RoomPack::_checkDupOffset(byte roomId, int32 offset)
ScummRpIO::info(INF_DETAIL, "Removed SC_0051 from index (duplicate of SC_0052)");
}
}
else if (j == 2 && ScummRp::tocs[i]->getType() == TableOfContent::TOCT_COST)
{
// Hack for Monkey1 Floppy VGA
if (roomId == 59 && ScummRp::tocs[i]->getSize() == 199
&& (*ScummRp::tocs[i])[10].offset == (*ScummRp::tocs[i])[117].offset
&& (*ScummRp::tocs[i])[10].roomId == (*ScummRp::tocs[i])[117].roomId)
{
(*ScummRp::tocs[i])[117].offset = -1;
j = 1;
ScummRpIO::info(INF_DETAIL, "Removed CO_0117 from index (duplicate of CO_0010)");
}
}
n += j;
if (n > 1)
throw RoomPack::BadOffset(xsprintf("Duplicate offset in index: 0x%X in room %i", offset, roomId));
Expand Down

0 comments on commit dc94b2a

Please sign in to comment.