project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m
changeset 11576 b709768e720c
parent 11560 b96080df19d0
child 11577 28afdaa159cb
--- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m	Tue Feb 23 23:29:06 2016 +0100
+++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m	Wed Feb 24 00:10:12 2016 +0100
@@ -241,25 +241,26 @@
 }
 
 +(void) startMissionGame:(NSString *)withScript {
-    // generate a seed
-    NSString *seed = [HWUtils seed];
-    NSString *seedCmd = [[NSString alloc] initWithFormat:@"eseed {%@}", seed];
-    [seed release];
-    
+    NSString *seedCmd = [self seedCommand];
     NSString *missionPath = [[NSString alloc] initWithFormat:@"escript Missions/Training/%@.lua",withScript];
-    
     NSDictionary *missionDict = [[NSDictionary alloc] initWithObjectsAndKeys:missionPath, @"mission_command", seedCmd, @"seed_command", nil];
     [missionPath release];
+    [seedCmd release];
 
     [self startGame:gtMission atPath:nil withOptions:missionDict];
     [missionDict release];
 }
 
-+(void) startSimpleGame {
++(NSString *) seedCommand {
     // generate a seed
     NSString *seed = [HWUtils seed];
     NSString *seedCmd = [[NSString alloc] initWithFormat:@"eseed {%@}", seed];
     [seed release];
+    return seedCmd;
+}
+
++(void) startSimpleGame {
+    NSString *seedCmd = [self seedCommand];
 
     // pick a random static map
     NSArray *listOfMaps = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:MAPS_DIRECTORY() error:NULL];