diff options
Diffstat (limited to 'engines/fullpipe/stateloader.cpp')
-rw-r--r-- | engines/fullpipe/stateloader.cpp | 27 |
1 files changed, 21 insertions, 6 deletions
diff --git a/engines/fullpipe/stateloader.cpp b/engines/fullpipe/stateloader.cpp index 4861699f7e..86865f928a 100644 --- a/engines/fullpipe/stateloader.cpp +++ b/engines/fullpipe/stateloader.cpp @@ -69,18 +69,21 @@ bool GameLoader::readSavegame(const char *fname) { byte *map = (byte *)malloc(800); saveFile->read(map, 800); - MfcArchive temp(new Common::MemoryReadStream(map, 800)); + Common::MemoryReadStream *tempStream = new Common::MemoryReadStream(map, 800); + MfcArchive temp(tempStream); if (_savegameCallback) _savegameCallback(&temp, false); + delete tempStream; delete saveFile; // Deobfuscate the data for (int i = 0; i < header.encSize; i++) data[i] -= i & 0x7f; - MfcArchive *archive = new MfcArchive(new Common::MemoryReadStream(data, header.encSize)); + Common::MemoryReadStream *archiveStream = new Common::MemoryReadStream(data, header.encSize); + MfcArchive *archive = new MfcArchive(archiveStream); GameVar *var = (GameVar *)archive->readClass(); @@ -91,6 +94,7 @@ bool GameLoader::readSavegame(const char *fname) { if (!v) { warning("No state to save"); + delete archiveStream; delete archive; return false; } @@ -121,6 +125,7 @@ bool GameLoader::readSavegame(const char *fname) { _sc2array[i]._isLoaded = 0; } + delete archiveStream; delete archive; getGameLoaderInventory()->rebuildItemRects(); @@ -288,8 +293,13 @@ bool FullpipeEngine::loadGam(const char *fname, int scene) { addMessageHandlerByIndex(global_messageHandler1, 0, 4); _inventory = getGameLoaderInventory(); - _inventory->setItemFlags(ANI_INV_MAP, 0x10003); - _inventory->addItem(ANI_INV_MAP, 1); + + if (isDemo() && getLanguage() == Common::RU_RUS) { + _inventory->addItem(ANI_INV_HAMMER, 1); + } else { + _inventory->setItemFlags(ANI_INV_MAP, 0x10003); + _inventory->addItem(ANI_INV_MAP, 1); + } _inventory->rebuildItemRects(); @@ -333,8 +343,13 @@ bool FullpipeEngine::loadGam(const char *fname, int scene) { _gameLoader->loadScene(SC_INTRO1); _gameLoader->gotoScene(SC_INTRO1, TrubaUp); } else { - _gameLoader->loadScene(SC_1); - _gameLoader->gotoScene(SC_1, TrubaLeft); + if (g_fp->isDemo() && g_fp->getLanguage() == Common::RU_RUS) { + _gameLoader->loadScene(SC_9); + _gameLoader->gotoScene(SC_9, TrubaDown); + } else { + _gameLoader->loadScene(SC_1); + _gameLoader->gotoScene(SC_1, TrubaLeft); + } } } |