aboutsummaryrefslogtreecommitdiff
path: root/sword2
diff options
context:
space:
mode:
authorTorbjörn Andersson2005-11-05 14:24:13 +0000
committerTorbjörn Andersson2005-11-05 14:24:13 +0000
commitffbbafed15b1625a94eb09680873ae8f7a636989 (patch)
tree84bd808e4316fc026dfdb6387a7712ba2f119873 /sword2
parentb8aaa2ed04d00e7937111735aaa845864f6aee98 (diff)
downloadscummvm-rg350-ffbbafed15b1625a94eb09680873ae8f7a636989.tar.gz
scummvm-rg350-ffbbafed15b1625a94eb09680873ae8f7a636989.tar.bz2
scummvm-rg350-ffbbafed15b1625a94eb09680873ae8f7a636989.zip
Call flush() in the savegame stream, when saving. I think SAGA, Simon and
BS2 were the last engines that didn't. But I could be mistaken. svn-id: r19463
Diffstat (limited to 'sword2')
-rw-r--r--sword2/save_rest.cpp10
1 files changed, 6 insertions, 4 deletions
diff --git a/sword2/save_rest.cpp b/sword2/save_rest.cpp
index cf948b7c14..06e8eb24de 100644
--- a/sword2/save_rest.cpp
+++ b/sword2/save_rest.cpp
@@ -125,13 +125,15 @@ uint32 Sword2Engine::saveData(uint16 slotNo, byte *buffer, uint32 bufferSize) {
return SR_ERR_FILEOPEN;
}
- uint32 itemsWritten = out->write(buffer, bufferSize);
+ out->write(buffer, bufferSize);
+ out->flush();
- delete out;
-
- if (itemsWritten == bufferSize)
+ if (!out->ioFailed()) {
+ delete out;
return SR_OK;
+ }
+ delete out;
return SR_ERR_WRITEFAIL;
}