From 184681f08f078f516a5f84dfbcbfb3daf78d1b14 Mon Sep 17 00:00:00 2001 From: Nekokabu Date: Fri, 4 Sep 2015 01:04:47 +0900 Subject: [PATCH] Fix Filename in compressed savestate --- Source/Project64/N64 System/N64 Class.cpp | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/Source/Project64/N64 System/N64 Class.cpp b/Source/Project64/N64 System/N64 Class.cpp index be17193fd..a6c3a3836 100644 --- a/Source/Project64/N64 System/N64 Class.cpp +++ b/Source/Project64/N64 System/N64 Class.cpp @@ -1419,8 +1419,19 @@ bool CN64System::SaveState() } else { - FileName.Format("%s%s",CurrentSaveName.c_str(), g_Settings->LoadDword(Setting_AutoZipInstantSave) ? ".pj.zip" : ".pj"); - ExtraInfoFileName.Format("%s.dat",FileName.c_str()); + char drive[_MAX_DRIVE], dir[_MAX_DIR], fname[_MAX_FNAME], ext[_MAX_EXT]; + _splitpath(CurrentSaveName.c_str(), drive, dir, fname, ext); + + FileName.Format("%s.pj", CurrentSaveName.c_str()); + + CurrentSaveName.Format("%s.pj", fname); + ExtraInfoFileName.Format("%s.dat", fname); + + //If ziping save add .zip on the end + if (g_Settings->LoadDword(Setting_AutoZipInstantSave)) + { + FileName.Format("%s.zip", FileName.c_str()); + } } if (FileName.empty()) { return true; }