aboutsummaryrefslogtreecommitdiff
path: root/engines/pink/objects
diff options
context:
space:
mode:
Diffstat (limited to 'engines/pink/objects')
-rw-r--r--engines/pink/objects/actors/actor.cpp4
-rw-r--r--engines/pink/objects/inventory.cpp2
-rw-r--r--engines/pink/objects/pages/game_page.cpp7
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);
+ }
}
}