Skip to content

Commit

Permalink
libcommon: Cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
danij-deng committed Feb 21, 2014
1 parent ec54087 commit 3c3ee02
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions doomsday/plugins/common/src/p_saveio.cpp
Expand Up @@ -31,7 +31,7 @@

static bool inited;
static LZFILE *savefile;
static de::Path saveName; // e.g., "savegame"
static de::Path savePath; // e.g., "savegame"
#if !__JHEXEN__
static de::Path clientSavePath; // e.g., "savegame/client"
#endif
Expand All @@ -44,7 +44,7 @@ static void *saveEndPtr;

void SV_InitIO()
{
saveName.clear();
savePath.clear();
#if !__JHEXEN__
clientSavePath.clear();
#endif
Expand All @@ -67,13 +67,13 @@ void SV_SetupSaveDirectory(de::Path newRootSaveDir)

if(!newRootSaveDir.isEmpty())
{
saveName = newRootSaveDir;
savePath = newRootSaveDir;
#if !__JHEXEN__
clientSavePath = newRootSaveDir / "client";
#endif

// Ensure that these paths exist.
bool savePathExists = F_MakePath(de::NativePath(saveName).expand().toUtf8().constData());
bool savePathExists = F_MakePath(de::NativePath(savePath).expand().toUtf8().constData());
#if !__JHEXEN__
if(!F_MakePath(de::NativePath(clientSavePath).expand().toUtf8().constData()))
{
Expand All @@ -87,19 +87,19 @@ void SV_SetupSaveDirectory(de::Path newRootSaveDir)
}
}

saveName.clear();
savePath.clear();
#if !__JHEXEN__
clientSavePath.clear();
#endif

App_Log(DE2_RES_ERROR, "SV_SetupSaveDirectory: \"%s\" could not be accessed. Perhaps it could "
"not be created (insufficient permissions?). Saving will not be possible.",
de::NativePath(saveName).pretty().toLatin1().constData());
de::NativePath(savePath).pretty().toLatin1().constData());
}

de::Path SV_SavePath()
{
return saveName;
return savePath;
}

#if !__JHEXEN__
Expand Down

0 comments on commit 3c3ee02

Please sign in to comment.