Create local saves dir if it does not exists (fixes #80)
This commit is contained in:
parent
3f20b4256b
commit
c62f65585a
@ -1,3 +1,8 @@
|
||||
#ifdef WIN
|
||||
#include <direct.h>
|
||||
#else
|
||||
#include <sys/stat.h>
|
||||
#endif
|
||||
#include "LocalSaveActivity.h"
|
||||
#include "interface/Label.h"
|
||||
#include "interface/Textbox.h"
|
||||
@ -105,6 +110,11 @@ void LocalSaveActivity::Save()
|
||||
|
||||
void LocalSaveActivity::saveWrite(std::string finalFilename)
|
||||
{
|
||||
#ifdef WIN
|
||||
_mkdir(LOCAL_SAVE_DIR);
|
||||
#else
|
||||
mkdir(LOCAL_SAVE_DIR, 0755);
|
||||
#endif
|
||||
Client::Ref().WriteFile(save.GetGameSave()->Serialise(), finalFilename);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user