diff options
-rw-r--r-- | engines/sci/engine/game.cpp | 8 | ||||
-rw-r--r-- | engines/sci/resource.cpp | 8 |
2 files changed, 7 insertions, 9 deletions
diff --git a/engines/sci/engine/game.cpp b/engines/sci/engine/game.cpp index 232e0eca55..241df94316 100644 --- a/engines/sci/engine/game.cpp +++ b/engines/sci/engine/game.cpp @@ -127,7 +127,13 @@ int game_init(EngineState *s) { srand(g_system->getMillis()); // Initialize random number generator - s->_gameObj = g_sci->getResMan()->findGameObject(); + // TODO: This is sometimes off by 1... find out why + //s->_gameObj = g_sci->getResMan()->findGameObject(); + // Replaced by the code below for now + Script *scr000 = s->_segMan->getScript(1); + s->_gameObj = make_reg(1, scr000->validateExportFunc(0)); + if (getSciVersion() >= SCI_VERSION_1_1) + s->_gameObj.offset += scr000->_scriptSize; #ifdef USE_OLD_MUSIC_FUNCTIONS if (s->sfx_init_flags & SFX_STATE_FLAG_NOSOUND) diff --git a/engines/sci/resource.cpp b/engines/sci/resource.cpp index ab46fa3abd..56ff24389e 100644 --- a/engines/sci/resource.cpp +++ b/engines/sci/resource.cpp @@ -1926,10 +1926,6 @@ 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); } @@ -1947,10 +1943,6 @@ Common::String ResourceManager::findSierraGameId() { 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 + gameObjectOffset + nameSelector * 2); Common::String sierraId; |