project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m
branchios-revival
changeset 11239 a954853e9c00
parent 11220 32366eb83383
child 11323 1f517a461c33
--- a/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m	Sat Oct 24 02:26:54 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/MissionTrainingViewController.m	Sat Oct 24 03:56:02 2015 +0200
@@ -135,6 +135,13 @@
             NSUInteger firstDotLocation = [line rangeOfString:@"."].location;
             
             NSString *missionID = [line substringToIndex:firstDotLocation];
+            
+            NSString *missionFullPath = [NSString stringWithFormat:@"%@%@.lua", TRAININGS_DIRECTORY(), missionID];
+            if (![[NSFileManager defaultManager] fileExistsAtPath:missionFullPath])
+            {
+                continue;
+            }
+            
             NSString *nameOrDesc = [line substringFromIndex:firstDotLocation+1];
             
             NSString *missionParsedName = ([nameOrDesc hasPrefix:@"name="]) ? [nameOrDesc stringByReplacingOccurrencesOfString:@"name=" withString:@""] : nil;