diff options
-rw-r--r-- | engines/sci/resource.cpp | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index d336cbab38..ab46fa3abd 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -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; |