Ticket #13711: savedata.diff

File savedata.diff, 936 bytes (added by henke37, 2 years ago)
  • engines/sludge/savedata.cpp"

    diff --git "a/engines/sludge/savedata.cpp" "b/engines/sludge/savedata.cpp"
    index 27e7154e3c9..9f37e98f2e9 100644
    "a "b  
    1919 *
    2020 */
    2121
     22#include "common/file.h"
    2223#include "common/savefile.h"
    2324#include "common/system.h"
    2425
    bool CustomSaveHelper::fileToStack(const Common::String &filename, StackHandler  
    9899        stringVar.varType = SVT_NULL;
    99100        Common::String checker = _saveEncoding ? "[Custom data (encoded)]\r\n" : "[Custom data (ASCII)]\n";
    100101
    101         Common::InSaveFile *fp = g_system->getSavefileManager()->openForLoading(filename);
     102        Common::SeekableReadStream *fp = g_system->getSavefileManager()->openForLoading(filename);
     103
     104        if (fp == NULL) {
     105                Common::File *f = new Common::File();
     106                if (f->open(filename)) {
     107                        fp = f;
     108                } else {
     109                        delete f;
     110                }
     111        }
    102112
    103113        if (fp == NULL) {
    104114                return fatal("No such file", filename); //TODO: false value