FIXED: Load most recent save game did not work

FIXED: Save to oldest save game always wrote to slot 1

git-svn-id: https://svn.code.sf.net/p/vbam/code/trunk@272 a31d4220-a93d-0410-bf67-fe4944624d44
This commit is contained in:
spacy51 2008-01-08 16:03:52 +00:00
parent b3232819b0
commit de1172a65b
1 changed files with 3 additions and 3 deletions

View File

@ -816,14 +816,14 @@ void MainWnd::OnFileSavegameOldestslot()
CString name; CString name;
CFileStatus status; CFileStatus status;
CString str; CString str;
time_t time = (time_t)-1; time_t time = 0;
int found = 0; int found = 0;
for(int i = 0; i < 10; i++) { for(int i = 0; i < 10; i++) {
name.Format("%s%s%d.sgm", saveDir, filename, i+1); name.Format("%s%s%d.sgm", saveDir, filename, i+1);
if(emulating && CFile::GetStatus(name, status)) { if(emulating && CFile::GetStatus(name, status)) {
if(status.m_mtime.GetTime() < time) { if( (status.m_mtime.GetTime() < time) || !time ) {
time = status.m_mtime.GetTime(); time = status.m_mtime.GetTime();
found = i; found = i;
} }
@ -929,7 +929,7 @@ void MainWnd::OnFileLoadgameMostrecent()
name.Format("%s%s%d.sgm", saveDir, filename, i+1); name.Format("%s%s%d.sgm", saveDir, filename, i+1);
if(emulating && CFile::GetStatus(name, status)) { if(emulating && CFile::GetStatus(name, status)) {
if(status.m_mtime.GetTime() < time) { if(status.m_mtime.GetTime() > time) {
time = status.m_mtime.GetTime(); time = status.m_mtime.GetTime();
found = i; found = i;
} }