diff options
author | whiterandrek | 2018-05-26 02:27:15 +0300 |
---|---|---|
committer | Eugene Sandulenko | 2018-06-28 23:51:32 +0200 |
commit | 90864279f4a0761ff43fc9c412b6c76d98a0a019 (patch) | |
tree | 9af0d9dbfb1ee8d5ebef7551db234f3a7a6c947c /engines | |
parent | 6ba76faa33fcc6f11dd21e49aadea32343476c86 (diff) | |
download | scummvm-rg350-90864279f4a0761ff43fc9c412b6c76d98a0a019.tar.gz scummvm-rg350-90864279f4a0761ff43fc9c412b6c76d98a0a019.tar.bz2 scummvm-rg350-90864279f4a0761ff43fc9c412b6c76d98a0a019.zip |
PINK: fixes to save system
Diffstat (limited to 'engines')
-rw-r--r-- | engines/pink/objects/actors/actor.cpp | 4 | ||||
-rw-r--r-- | engines/pink/objects/inventory.cpp | 2 | ||||
-rw-r--r-- | engines/pink/objects/pages/game_page.cpp | 7 |
3 files changed, 7 insertions, 6 deletions
diff --git a/engines/pink/objects/actors/actor.cpp b/engines/pink/objects/actors/actor.cpp index abcb66502e..a1d179b945 100644 --- a/engines/pink/objects/actors/actor.cpp +++ b/engines/pink/objects/actors/actor.cpp @@ -132,9 +132,7 @@ Actor::~Actor() { } void Actor::loadState(Archive &archive) { - Common::String actionName; - actionName = archive.readString(); - _action = findAction(actionName); + _action = findAction(archive.readString()); } void Actor::saveState(Archive &archive) { diff --git a/engines/pink/objects/inventory.cpp b/engines/pink/objects/inventory.cpp index 4a7d02d9be..3ae4effd0a 100644 --- a/engines/pink/objects/inventory.cpp +++ b/engines/pink/objects/inventory.cpp @@ -204,7 +204,7 @@ void InventoryMgr::loadState(Archive &archive) { } const Common::String currItemName = archive.readString(); - if (!currItemName.empty()) { + if (currItemName.empty()) { _item = nullptr; _isClickedOnItem = 0; } else { diff --git a/engines/pink/objects/pages/game_page.cpp b/engines/pink/objects/pages/game_page.cpp index 883e129670..f6b843fae2 100644 --- a/engines/pink/objects/pages/game_page.cpp +++ b/engines/pink/objects/pages/game_page.cpp @@ -169,7 +169,7 @@ void GamePage::loadState(Archive &archive) { uint size = archive.readDWORD(); _memFile = new Common::MemoryReadWriteStream(DisposeAfterUse::YES); for (uint i = 0; i < size; ++i) { - _memFile->writeByte(_memFile->readByte()); + _memFile->writeByte(archive.readByte()); } } @@ -177,12 +177,15 @@ void GamePage::saveState(Archive &archive) { if (this == _module->getPage()) { saveStateToMem(); archive.writeDWORD(_memFile->size()); + archive.getWriteStream()->write(_memFile->getData(), _memFile->size()); + delete _memFile; } else { if (_memFile != nullptr) { archive.writeDWORD(_memFile->size()); archive.getWriteStream()->write(_memFile->getData(), _memFile->size()); - } else + } else { archive.writeDWORD(0); + } } } |