Removed the complex check for an existing commander at the last saved location. There are a lot of situations were you still want to proceed with loading a saved game in such situations. e.g. you moved your files on your disk or want to retrieve them from an external source.

git-svn-id: http://svn.berlios.de/svnroot/repos/oolite-linux/trunk@5471 127b21dd-08f5-0310-b4b7-95ae10353056
This commit is contained in:
Eric Walch 2012-11-03 14:56:35 +00:00
parent b3afb60655
commit 1e2108056a

View File

@ -7201,37 +7201,10 @@ static NSString *last_outfitting_key=nil;
[gui setText:text forRow:17 align:GUI_ALIGN_CENTER];
[gui setColor:[OOColor grayColor] forRow:17];
// Ask to load previous commander only if we have at least one previous commander to load.
text = DESC(@"load-previous-commander");
[gui setText:text forRow:19 align:GUI_ALIGN_CENTER];
[gui setColor:[OOColor yellowColor] forRow:19];
NSFileManager *saveFileManager = [NSFileManager defaultManager];
NSArray *cdrArray = [saveFileManager commanderContentsOfPath: [[UNIVERSE gameController] playerFileDirectory]];
unsigned j;
BOOL fileExists, isDir, oneCdr = NO;
for(j = 0; j < [cdrArray count] && !oneCdr; j++)
{
NSString* path = [cdrArray objectAtIndex:j];
fileExists = [saveFileManager fileExistsAtPath:path isDirectory:&isDir];
if (fileExists && !isDir && [[[path pathExtension] lowercaseString] isEqualToString:@"oolite-save"])
{
oneCdr = YES;
}
}
if (oneCdr)
{
text = DESC(@"load-previous-commander");
[gui setText:text forRow:19 align:GUI_ALIGN_CENTER];
[gui setColor:[OOColor yellowColor] forRow:19];
}
else
{
text = DESC(@"press-space-commander");
[gui setText:text forRow:21 align:GUI_ALIGN_CENTER];
[gui setColor:[OOColor yellowColor] forRow:21];
justCobra = NO;
}
// check for error messages from Resource Manager
//[ResourceManager paths]; done in Universe already