1. // this function was used to delete a save from the 'save' folder
void GameSaveState::DeleteSelection()
{
int currTab = tabWindow->GetCurrTab();
if (currTab == 0 && (incompleteSave.empty() || selectionIndex >=
(int)incompleteSave.size())) return;
if (currTab == 1 && (completeSave.empty() || selectionIndex >=
(int)completeSave.size())) return;
int result;
if (currTab == 0)
{
wostringstream currFile;
currFile << incompleteSave[selectionIndex].address.c_str();
result = DeleteFile(wstring(currFile.str()).c_str());
incompleteSave.erase(incompleteSave.begin() + selectionIndex);
}
else
{
wostringstream currFile;
currFile << completeSave[selectionIndex].address.c_str();
result = DeleteFile(wstring(currFile.str()).c_str());
completeSave.erase(completeSave.begin() + selectionIndex);
}
if (0 == result)
DWORD err = GetLastError();
}