diff options
-rw-r--r-- | engines/dm/dm.cpp | 1 | ||||
-rw-r--r-- | engines/dm/dm.h | 1 | ||||
-rw-r--r-- | engines/dm/group.cpp | 4 | ||||
-rw-r--r-- | engines/dm/loadsave.cpp | 34 |
4 files changed, 17 insertions, 23 deletions
diff --git a/engines/dm/dm.cpp b/engines/dm/dm.cpp index 4355355d48..32ee941b93 100644 --- a/engines/dm/dm.cpp +++ b/engines/dm/dm.cpp @@ -138,7 +138,6 @@ DMEngine::DMEngine(OSystem *syst, const DMADGameDescription *desc) : Engine(syst _stopWaitingForPlayerInput = true; _gameTimeTicking = false; _restartGameAllowed = false; - _gameId = 0; _pressingEye = false; _stopPressingEye = false; _pressingMouth = false; diff --git a/engines/dm/dm.h b/engines/dm/dm.h index 0a73c05ff0..15633bfbb6 100644 --- a/engines/dm/dm.h +++ b/engines/dm/dm.h @@ -304,7 +304,6 @@ public: bool _stopWaitingForPlayerInput; // @ G0321_B_StopWaitingForPlayerInput bool _gameTimeTicking; // @ G0301_B_GameTimeTicking bool _restartGameAllowed; // @ G0524_B_RestartGameAllowed - int32 _gameId; // @ G0525_l_GameID, probably useless here bool _pressingEye; // @ G0331_B_PressingEye bool _stopPressingEye; // @ G0332_B_StopPressingEye bool _pressingMouth; // @ G0333_B_PressingMouth diff --git a/engines/dm/group.cpp b/engines/dm/group.cpp index 62b82cf56a..39b54e1f3b 100644 --- a/engines/dm/group.cpp +++ b/engines/dm/group.cpp @@ -199,7 +199,7 @@ void GroupMan::dropCreatureFixedPossessions(uint16 creatureType, int16 mapX, int }; static uint16 fixedPossessionCreature4PainRatHellHound[3] = { // @ G0250_aui_Graphic559_FixedPossessionsCreature04PainRat_Hellhound kDMObjectInfoIndexFirstJunk + kDMJunkTypeDrumstickShank, - kDMObjectInfoIndexFirstJunk + kDMJunkTypeDrumstickShank | kDMMaskRandomDrop, + (kDMObjectInfoIndexFirstJunk + kDMJunkTypeDrumstickShank) | kDMMaskRandomDrop, 0 }; static uint16 fixedPossessionCreature6screamer[3] = { // @ G0251_aui_Graphic559_FixedPossessionsCreature06Screamer @@ -393,7 +393,7 @@ int16 GroupMan::groupGetDamageCreatureOutcome(Group *group, uint16 creatureIndex if (group->_health[creatureIndex] <= damage) { uint16 groupCells = getGroupCells(group, _vm->_dungeonMan->_currMapIndex); - uint16 cell = (groupCells == k255_CreatureTypeSingleCenteredCreature) ? k255_CreatureTypeSingleCenteredCreature : getCreatureValue(groupCells, creatureIndex); + uint16 cell = (groupCells == k255_CreatureTypeSingleCenteredCreature) ? (uint16)k255_CreatureTypeSingleCenteredCreature : getCreatureValue(groupCells, creatureIndex); uint16 creatureCount = group->getCount(); uint16 retVal; diff --git a/engines/dm/loadsave.cpp b/engines/dm/loadsave.cpp index fe7c6f11cb..6e9d98656d 100644 --- a/engines/dm/loadsave.cpp +++ b/engines/dm/loadsave.cpp @@ -56,24 +56,19 @@ LoadgameResult DMEngine::loadgame(int16 slot) { int32 _saveVersion; OriginalSaveFormat _saveFormat; OriginalSavePlatform _savePlatform; - - int32 _gameId; uint16 _dungeonId; } dmSaveHeader; - if (!_newGameFl) { - fileName = getSavefileName(slot); - saveFileManager = _system->getSavefileManager(); - file = saveFileManager->openForLoading(fileName); - } - if (_newGameFl) { //L1366_B_FadePalette = !F0428_DIALOG_RequireGameDiskInDrive_NoDialogDrawn(C0_DO_NOT_FORCE_DIALOG_DM_CSB, true); _restartGameAllowed = false; _championMan->_partyChampionCount = 0; _championMan->_leaderHandObject = Thing::_none; - _gameId = ((int32)getRandomNumber(65536)) * getRandomNumber(65536); } else { + fileName = getSavefileName(slot); + saveFileManager = _system->getSavefileManager(); + file = saveFileManager->openForLoading(fileName); + SaveGameHeader header; readSaveGameHeader(file, &header); @@ -83,10 +78,10 @@ LoadgameResult DMEngine::loadgame(int16 slot) { dmSaveHeader._saveVersion = file->readSint32BE(); dmSaveHeader._saveFormat = (OriginalSaveFormat)file->readSint32BE(); dmSaveHeader._savePlatform = (OriginalSavePlatform)file->readSint32BE(); - dmSaveHeader._gameId = file->readSint32BE(); - dmSaveHeader._dungeonId = file->readUint16BE(); - _gameId = dmSaveHeader._gameId; + // Skip _gameId, which was useless + file->readSint32BE(); + dmSaveHeader._dungeonId = file->readUint16BE(); _gameTime = file->readSint32BE(); // G0349_ul_LastRandomNumber = L1371_s_GlobalData.LastRandomNumber; @@ -121,6 +116,8 @@ LoadgameResult DMEngine::loadgame(int16 slot) { // read sentinel uint32 sentinel = file->readUint32BE(); assert(sentinel == 0x6f85e3d3); + + _dungeonId = dmSaveHeader._dungeonId; } _dungeonMan->loadDungeonFile(file); @@ -137,21 +134,18 @@ LoadgameResult DMEngine::loadgame(int16 slot) { _displayMan->startEndFadeToPalette(_displayMan->_paletteTopAndBottomScreen); } } else { - _dungeonId = dmSaveHeader._dungeonId; - _restartGameAllowed = true; switch (getGameLanguage()) { // localized - default: - case Common::EN_ANY: - _dialog->dialogDraw(nullptr, "LOADING GAME . . .", nullptr, nullptr, nullptr, nullptr, true, true, true); - break; case Common::DE_DEU: _dialog->dialogDraw(nullptr, "SPIEL WIRD GELADEN . . .", nullptr, nullptr, nullptr, nullptr, true, true, true); break; case Common::FR_FRA: _dialog->dialogDraw(nullptr, "CHARGEMENT DU JEU . . .", nullptr, nullptr, nullptr, nullptr, true, true, true); break; + default: + _dialog->dialogDraw(nullptr, "LOADING GAME . . .", nullptr, nullptr, nullptr, nullptr, true, true, true); + break; } } _championMan->_partyDead = false; @@ -298,7 +292,9 @@ bool DMEngine::writeCompleteSaveFile(int16 saveSlot, Common::String& saveDescrip file->writeSint32BE(1); // save version file->writeSint32BE(_gameVersion->_origSaveFormatToWrite); file->writeSint32BE(_gameVersion->_origPlatformToWrite); - file->writeSint32BE(_gameId); + + // Was _gameID, useless. + file->writeSint32BE(0); file->writeUint16BE(_dungeonId); // write C0_SAVE_PART_GLOBAL_DATA part |