project_files/HedgewarsMobile/Classes/GameSetup.m
changeset 3916 e7d665a4ef42
parent 3912 e11df2de6af2
child 3922 44804043b691
--- a/project_files/HedgewarsMobile/Classes/GameSetup.m	Wed Sep 29 16:16:25 2010 -0400
+++ b/project_files/HedgewarsMobile/Classes/GameSetup.m	Wed Sep 29 23:50:46 2010 +0200
@@ -24,7 +24,6 @@
 #import "SDL_net.h"
 #import "PascalImports.h"
 #import "CommodityFunctions.h"
-#import "NSStringExtra.h"
 #import "OverlayViewController.h"
 
 #define BUFFER_SIZE 255     // like in original frontend
@@ -209,7 +208,11 @@
     [self sendToEngine:dmgMod];
     [dmgMod release];
 
-    NSString *turnTime = [[NSString alloc] initWithFormat:@"e$turntime %d",[[basicArray objectAtIndex:i++] intValue] * 1000];
+    // support for endless games
+    int tentativeTurntime = [[basicArray objectAtIndex:i++] intValue];
+    if (tentativeTurntime == 100)
+        tentativeTurntime = 9999;
+    NSString *turnTime = [[NSString alloc] initWithFormat:@"e$turntime %d",tentativeTurntime * 1000];
     [self sendToEngine:turnTime];
     [turnTime release];