mirror of
https://github.com/vcmi/vcmi.git
synced 2025-11-29 23:07:48 +02:00
Merge branch 'develop' of github.com:karol57/vcmi into karol57-develop
This commit is contained in:
@@ -42,13 +42,6 @@
|
||||
#include "../lib/UnlockGuard.h"
|
||||
#include <SDL.h>
|
||||
|
||||
#ifdef min
|
||||
#undef min
|
||||
#endif
|
||||
#ifdef max
|
||||
#undef max
|
||||
#endif
|
||||
|
||||
/*
|
||||
* CPlayerInterface.cpp, part of VCMI engine
|
||||
*
|
||||
@@ -1622,22 +1615,20 @@ int CPlayerInterface::getLastIndex( std::string namePrefix)
|
||||
path gamesDir = VCMIDirs::get().userSavePath();
|
||||
std::map<std::time_t, int> dates; //save number => datestamp
|
||||
|
||||
directory_iterator enddir;
|
||||
const directory_iterator enddir;
|
||||
if(!exists(gamesDir))
|
||||
create_directory(gamesDir);
|
||||
|
||||
for (directory_iterator dir(gamesDir); dir!=enddir; dir++)
|
||||
else
|
||||
for (directory_iterator dir(gamesDir); dir != enddir; ++dir)
|
||||
{
|
||||
if(is_regular(dir->status()))
|
||||
{
|
||||
std::string name = dir->path().leaf().string();
|
||||
std::string name = dir->path().filename().string();
|
||||
if(starts_with(name, namePrefix) && ends_with(name, ".vcgm1"))
|
||||
{
|
||||
char nr = name[namePrefix.size()];
|
||||
if(std::isdigit(nr))
|
||||
{
|
||||
dates[last_write_time(dir->path())] = boost::lexical_cast<int>(nr);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user