diff options
| author | Torbjörn Andersson | 2005-11-05 14:24:13 +0000 |
|---|---|---|
| committer | Torbjörn Andersson | 2005-11-05 14:24:13 +0000 |
| commit | ffbbafed15b1625a94eb09680873ae8f7a636989 (patch) | |
| tree | 84bd808e4316fc026dfdb6387a7712ba2f119873 /sword2 | |
| parent | b8aaa2ed04d00e7937111735aaa845864f6aee98 (diff) | |
| download | scummvm-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.cpp | 10 |
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; } |
