mirror of
https://github.com/vcmi/vcmi.git
synced 2025-06-15 00:05:02 +02:00
Compile fix for MSVC.
Fixed crash when no maps are present. Fixed crash on opening the loading screen. Fixed crash on starting the turn when Games/ subfolder is not present.
This commit is contained in:
@ -1579,10 +1579,14 @@ int CPlayerInterface::getLastIndex( std::string namePrefix)
|
||||
using namespace boost::filesystem;
|
||||
using namespace boost::algorithm;
|
||||
|
||||
path gamesDir = GVCMIDirs.UserPath + "/Games";
|
||||
std::map<std::time_t, int> dates; //save number => datestamp
|
||||
|
||||
directory_iterator enddir;
|
||||
for (directory_iterator dir(GVCMIDirs.UserPath + "/Games"); dir!=enddir; dir++)
|
||||
if(!exists(gamesDir))
|
||||
create_directory(gamesDir);
|
||||
|
||||
for (directory_iterator dir(gamesDir); dir!=enddir; dir++)
|
||||
{
|
||||
if(is_regular(dir->status()))
|
||||
{
|
||||
|
Reference in New Issue
Block a user