--- a/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m Wed Feb 17 23:27:13 2016 +0100
+++ b/project_files/HedgewarsMobile/Classes/EngineProtocolNetwork.m Fri Feb 19 00:07:59 2016 +0100
@@ -273,13 +273,14 @@
NSString *script = [gameConfig objectForKey:@"mission_command"];
if ([script length] != 0)
[self sendToEngine:script];
- // missions/tranings only need the script configuration set
- if ([gameConfig count] == 1)
- break;
-
+
// seed info
[self sendToEngine:[gameConfig objectForKey:@"seed_command"]];
+ // missions/tranings only need the script configuration set and seed
+ if ([HWUtils gameType] == gtMission)
+ break;
+
// dimension of the map
[self sendToEngine:[gameConfig objectForKey:@"templatefilter_command"]];
[self sendToEngine:[gameConfig objectForKey:@"mapgen_command"]];
--- a/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m Wed Feb 17 23:27:13 2016 +0100
+++ b/project_files/HedgewarsMobile/Classes/GameInterfaceBridge.m Fri Feb 19 00:07:59 2016 +0100
@@ -241,12 +241,18 @@
}
+(void) startMissionGame:(NSString *)withScript {
+ // generate a seed
+ NSString *seed = [HWUtils seed];
+ NSString *seedCmd = [[NSString alloc] initWithFormat:@"eseed {%@}", seed];
+ [seed release];
+
NSString *missionPath = [[NSString alloc] initWithFormat:@"escript Missions/Training/%@.lua",withScript];
- NSDictionary *missionLine = [[NSDictionary alloc] initWithObjectsAndKeys:missionPath,@"mission_command",nil];
+
+ NSDictionary *missionDict = [[NSDictionary alloc] initWithObjectsAndKeys:missionPath, @"mission_command", seedCmd, @"seed_command", nil];
[missionPath release];
- [self startGame:gtMission atPath:nil withOptions:missionLine];
- [missionLine release];
+ [self startGame:gtMission atPath:nil withOptions:missionDict];
+ [missionDict release];
}
+(void) startSimpleGame {