Fixed regression in SCI2-SCI21 games from commit 49308

svn-id: r49309
This commit is contained in:
Filippos Karapetis 2010-05-29 15:01:33 +00:00
parent 6f056c6c98
commit 708b37898c

View file

@ -1926,6 +1926,10 @@ reg_t ResourceManager::findGameObject(bool addSci11ScriptOffset) {
if (getSciVersion() >= SCI_VERSION_1_1 && addSci11ScriptOffset)
offset += script->size;
// TODO: Investigate why this is needed for SCI2+ games
if (getSciVersion() >= SCI_VERSION_2)
offset += 1;
return make_reg(1, offset);
}
@ -1941,8 +1945,14 @@ Common::String ResourceManager::findSierraGameId() {
nameSelector += 5;
}
int16 gameObjectOffset = findGameObject(false).offset;
// Compensate for the odd offsets of SCI2+ games
if (getSciVersion() >= SCI_VERSION_2)
gameObjectOffset -= 1;
// Seek to the name selector of the first export
byte *seeker = heap->data + READ_UINT16(heap->data + findGameObject(false).offset + nameSelector * 2);
byte *seeker = heap->data + READ_UINT16(heap->data + gameObjectOffset + nameSelector * 2);
Common::String sierraId;
sierraId += (const char *)seeker;