this should prevent that ever again
authorkoda
Wed, 22 Dec 2010 03:28:14 +0100
changeset 4605 a5c2f09daaaa
parent 4603 d362ab6c7f53
child 4607 7f683c2357a0
this should prevent that ever again
project_files/HedgewarsMobile/Classes/CreationChamber.m
project_files/HedgewarsMobile/Classes/GameSetup.m
project_files/HedgewarsMobile/Resources/Settings/Schemes/Barrel Mayhem.plist
project_files/HedgewarsMobile/Resources/Settings/Schemes/Clean Slate.plist
project_files/HedgewarsMobile/Resources/Settings/Schemes/Default.plist
project_files/HedgewarsMobile/Resources/Settings/Schemes/Fort Mode.plist
project_files/HedgewarsMobile/Resources/Settings/Schemes/King Mode.plist
project_files/HedgewarsMobile/Resources/Settings/Schemes/Minefield.plist
project_files/HedgewarsMobile/Resources/Settings/Schemes/Pro Mode.plist
project_files/HedgewarsMobile/Resources/Settings/Schemes/Shoppa.plist
project_files/HedgewarsMobile/Resources/Settings/Schemes/Thinking with Portals.plist
project_files/HedgewarsMobile/Resources/Settings/Schemes/Timeless.plist
project_files/HedgewarsMobile/Resources/Settings/Schemes/Tunnel Hogs.plist
project_files/HedgewarsMobile/Resources/Settings/iFrontend/basicFlags_en.plist
--- a/project_files/HedgewarsMobile/Classes/CreationChamber.m	Wed Dec 22 03:05:28 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/CreationChamber.m	Wed Dec 22 03:28:14 2010 +0100
@@ -147,9 +147,8 @@
 
     NSMutableArray *basicArray  = [[NSMutableArray alloc] initWithObjects:
                                    [NSNumber numberWithInt:100],      //initialhealth
+                                   [NSNumber numberWithInt:100],      //damagemodifier
                                    [NSNumber numberWithInt:45],       //turntime
-                                   [NSNumber numberWithInt:3],        //minestime
-                                   [NSNumber numberWithInt:100],      //damagemodifier
                                    [NSNumber numberWithInt:15],       //suddendeathtimeout
                                    [NSNumber numberWithInt:47],       //waterrise
                                    [NSNumber numberWithInt:5],        //healthdecrease
@@ -157,6 +156,7 @@
                                    [NSNumber numberWithInt:5],        //cratedrops
                                    [NSNumber numberWithInt:35],       //healthprob
                                    [NSNumber numberWithInt:25],       //healthamount
+                                   [NSNumber numberWithInt:3],        //minestime
                                    [NSNumber numberWithInt:4],        //minesnumber
                                    [NSNumber numberWithInt:0],        //dudmines
                                    [NSNumber numberWithInt:2],        //explosives
--- a/project_files/HedgewarsMobile/Classes/GameSetup.m	Wed Dec 22 03:05:28 2010 +0100
+++ b/project_files/HedgewarsMobile/Classes/GameSetup.m	Wed Dec 22 03:28:14 2010 +0100
@@ -182,28 +182,16 @@
     NSArray *mods = [[NSArray alloc] initWithContentsOfFile:path];
     [path release];
 
-    int i = 0;
-    // initial health
-    result = [[basicArray objectAtIndex:i++] intValue];
+    result = [[basicArray objectAtIndex:0] intValue];
 
-    // turn time
-    NSInteger 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];
-
-    NSString *minesTime = [[NSString alloc] initWithFormat:@"e$minestime %d",[[basicArray objectAtIndex:i++] intValue] * 1000];
-    [self sendToEngine:minesTime];
-    [minesTime release];
-
-    for (; i < [basicArray count]; i++) {
-        NSDictionary *basicDict = [mods objectAtIndex:i];
-        NSString *command = [basicDict objectForKey:@"command"];
+    for (int i = 1; i < [basicArray count]; i++) {
+        NSDictionary *dict = [mods objectAtIndex:i];
+        NSString *command = [dict objectForKey:@"command"];
         NSInteger value = [[basicArray objectAtIndex:i] intValue];
-        if ([basicDict objectForKey:@"checkOverMax"] && value >= [[basicDict objectForKey:@"max"] intValue])
+        if ([[dict objectForKey:@"checkOverMax"] boolValue] && value >= [[dict objectForKey:@"max"] intValue])
             value = 9999;
+        if ([[dict objectForKey:@"times1000"] boolValue])
+            value = value * 1000;
         NSString *strToSend = [[NSString alloc] initWithFormat:@"%@ %d",command,value];
         [self sendToEngine:strToSend];
         [strToSend release];
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Barrel Mayhem.plist	Wed Dec 22 03:05:28 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Barrel Mayhem.plist	Wed Dec 22 03:28:14 2010 +0100
@@ -5,9 +5,8 @@
 	<key>basic</key>
 	<array>
 		<integer>100</integer>
+		<integer>100</integer>
 		<integer>30</integer>
-		<integer>0</integer>
-		<integer>100</integer>
 		<integer>15</integer>
 		<integer>47</integer>
 		<integer>5</integer>
@@ -17,6 +16,7 @@
 		<integer>25</integer>
 		<integer>0</integer>
 		<integer>0</integer>
+		<integer>0</integer>
 		<integer>40</integer>
 	</array>
 	<key>gamemod</key>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Clean Slate.plist	Wed Dec 22 03:05:28 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Clean Slate.plist	Wed Dec 22 03:28:14 2010 +0100
@@ -5,9 +5,8 @@
 	<key>basic</key>
 	<array>
 		<integer>100</integer>
+		<integer>100</integer>
 		<integer>45</integer>
-		<integer>3</integer>
-		<integer>100</integer>
 		<integer>15</integer>
 		<integer>47</integer>
 		<integer>5</integer>
@@ -15,6 +14,7 @@
 		<integer>5</integer>
 		<integer>35</integer>
 		<integer>25</integer>
+		<integer>3</integer>
 		<integer>4</integer>
 		<integer>0</integer>
 		<integer>2</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Default.plist	Wed Dec 22 03:05:28 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Default.plist	Wed Dec 22 03:28:14 2010 +0100
@@ -5,9 +5,8 @@
 	<key>basic</key>
 	<array>
 		<integer>100</integer>
+		<integer>100</integer>
 		<integer>45</integer>
-		<integer>3</integer>
-		<integer>100</integer>
 		<integer>15</integer>
 		<integer>47</integer>
 		<integer>5</integer>
@@ -15,6 +14,7 @@
 		<integer>5</integer>
 		<integer>35</integer>
 		<integer>25</integer>
+		<integer>3</integer>
 		<integer>4</integer>
 		<integer>0</integer>
 		<integer>2</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Fort Mode.plist	Wed Dec 22 03:05:28 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Fort Mode.plist	Wed Dec 22 03:28:14 2010 +0100
@@ -5,9 +5,8 @@
 	<key>basic</key>
 	<array>
 		<integer>100</integer>
+		<integer>100</integer>
 		<integer>45</integer>
-		<integer>3</integer>
-		<integer>100</integer>
 		<integer>15</integer>
 		<integer>47</integer>
 		<integer>5</integer>
@@ -15,6 +14,7 @@
 		<integer>5</integer>
 		<integer>35</integer>
 		<integer>25</integer>
+		<integer>3</integer>
 		<integer>0</integer>
 		<integer>0</integer>
 		<integer>0</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/King Mode.plist	Wed Dec 22 03:05:28 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/King Mode.plist	Wed Dec 22 03:28:14 2010 +0100
@@ -5,9 +5,8 @@
 	<key>basic</key>
 	<array>
 		<integer>100</integer>
+		<integer>100</integer>
 		<integer>45</integer>
-		<integer>3</integer>
-		<integer>100</integer>
 		<integer>15</integer>
 		<integer>47</integer>
 		<integer>5</integer>
@@ -15,6 +14,7 @@
 		<integer>5</integer>
 		<integer>35</integer>
 		<integer>25</integer>
+		<integer>3</integer>
 		<integer>4</integer>
 		<integer>0</integer>
 		<integer>2</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Minefield.plist	Wed Dec 22 03:05:28 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Minefield.plist	Wed Dec 22 03:28:14 2010 +0100
@@ -5,9 +5,8 @@
 	<key>basic</key>
 	<array>
 		<integer>50</integer>
+		<integer>150</integer>
 		<integer>30</integer>
-		<integer>0</integer>
-		<integer>150</integer>
 		<integer>15</integer>
 		<integer>47</integer>
 		<integer>5</integer>
@@ -15,6 +14,7 @@
 		<integer>0</integer>
 		<integer>35</integer>
 		<integer>25</integer>
+		<integer>0</integer>
 		<integer>80</integer>
 		<integer>0</integer>
 		<integer>0</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Pro Mode.plist	Wed Dec 22 03:05:28 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Pro Mode.plist	Wed Dec 22 03:28:14 2010 +0100
@@ -5,9 +5,8 @@
 	<key>basic</key>
 	<array>
 		<integer>100</integer>
+		<integer>100</integer>
 		<integer>15</integer>
-		<integer>3</integer>
-		<integer>100</integer>
 		<integer>15</integer>
 		<integer>47</integer>
 		<integer>5</integer>
@@ -15,6 +14,7 @@
 		<integer>0</integer>
 		<integer>35</integer>
 		<integer>25</integer>
+		<integer>3</integer>
 		<integer>0</integer>
 		<integer>0</integer>
 		<integer>2</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Shoppa.plist	Wed Dec 22 03:05:28 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Shoppa.plist	Wed Dec 22 03:28:14 2010 +0100
@@ -5,9 +5,8 @@
 	<key>basic</key>
 	<array>
 		<integer>100</integer>
+		<integer>100</integer>
 		<integer>300</integer>
-		<integer>3</integer>
-		<integer>100</integer>
 		<integer>50</integer>
 		<integer>47</integer>
 		<integer>5</integer>
@@ -15,6 +14,7 @@
 		<integer>1</integer>
 		<integer>0</integer>
 		<integer>35</integer>
+		<integer>3</integer>
 		<integer>0</integer>
 		<integer>0</integer>
 		<integer>0</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Thinking with Portals.plist	Wed Dec 22 03:05:28 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Thinking with Portals.plist	Wed Dec 22 03:28:14 2010 +0100
@@ -5,9 +5,8 @@
 	<key>basic</key>
 	<array>
 		<integer>100</integer>
+		<integer>100</integer>
 		<integer>45</integer>
-		<integer>4</integer>
-		<integer>100</integer>
 		<integer>15</integer>
 		<integer>47</integer>
 		<integer>5</integer>
@@ -15,6 +14,7 @@
 		<integer>2</integer>
 		<integer>25</integer>
 		<integer>25</integer>
+		<integer>4</integer>
 		<integer>5</integer>
 		<integer>0</integer>
 		<integer>5</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Timeless.plist	Wed Dec 22 03:05:28 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Timeless.plist	Wed Dec 22 03:28:14 2010 +0100
@@ -6,7 +6,6 @@
 	<array>
 		<integer>100</integer>
 		<integer>100</integer>
-		<integer>5</integer>
 		<integer>100</integer>
 		<integer>100</integer>
 		<integer>47</integer>
@@ -15,6 +14,7 @@
 		<integer>5</integer>
 		<integer>35</integer>
 		<integer>30</integer>
+		<integer>5</integer>
 		<integer>3</integer>
 		<integer>10</integer>
 		<integer>2</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/Schemes/Tunnel Hogs.plist	Wed Dec 22 03:05:28 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/Schemes/Tunnel Hogs.plist	Wed Dec 22 03:28:14 2010 +0100
@@ -5,15 +5,15 @@
 	<key>basic</key>
 	<array>
 		<integer>100</integer>
+		<integer>100</integer>
 		<integer>30</integer>
-		<integer>3</integer>
-		<integer>100</integer>
 		<integer>15</integer>
 		<integer>47</integer>
 		<integer>5</integer>
 		<integer>100</integer>
 		<integer>5</integer>
 		<integer>35</integer>
+		<integer>3</integer>
 		<integer>25</integer>
 		<integer>10</integer>
 		<integer>10</integer>
--- a/project_files/HedgewarsMobile/Resources/Settings/iFrontend/basicFlags_en.plist	Wed Dec 22 03:05:28 2010 +0100
+++ b/project_files/HedgewarsMobile/Resources/Settings/iFrontend/basicFlags_en.plist	Wed Dec 22 03:28:14 2010 +0100
@@ -3,10 +3,6 @@
 <plist version="1.0">
 <array>
 	<dict>
-		<key>checkOverMax</key>
-		<false/>
-		<key>command</key>
-		<string></string>
 		<key>default</key>
 		<integer>100</integer>
 		<key>image</key>
@@ -21,37 +17,7 @@
 	<dict>
 		<key>checkOverMax</key>
 		<false/>
-		<key>command</key>
-		<string>e$turntime</string>
-		<key>default</key>
-		<integer>45</integer>
-		<key>image</key>
-		<string>Time</string>
-		<key>max</key>
-		<integer>100</integer>
-		<key>min</key>
-		<integer>1</integer>
-		<key>title</key>
-		<string>Turn Time</string>
-	</dict>
-	<dict>
-		<key>checkOverMax</key>
-		<false/>
-		<key>command</key>
-		<string>e$minestime</string>
-		<key>default</key>
-		<integer>3</integer>
-		<key>image</key>
-		<string>Time</string>
-		<key>max</key>
-		<integer>5</integer>
-		<key>min</key>
-		<integer>-1</integer>
-		<key>title</key>
-		<string>Mines Time</string>
-	</dict>
-	<dict>
-		<key>checkOverMax</key>
+		<key>times1000</key>
 		<false/>
 		<key>command</key>
 		<string>e$damagepct</string>
@@ -69,6 +35,26 @@
 	<dict>
 		<key>checkOverMax</key>
 		<true/>
+		<key>times1000</key>
+		<true/>
+		<key>command</key>
+		<string>e$turntime</string>
+		<key>default</key>
+		<integer>45</integer>
+		<key>image</key>
+		<string>Time</string>
+		<key>max</key>
+		<integer>100</integer>
+		<key>min</key>
+		<integer>1</integer>
+		<key>title</key>
+		<string>Turn Time</string>
+	</dict>
+	<dict>
+		<key>checkOverMax</key>
+		<true/>
+		<key>times1000</key>
+		<false/>
 		<key>command</key>
 		<string>e$sd_turns</string>
 		<key>default</key>
@@ -85,6 +71,8 @@
 	<dict>
 		<key>checkOverMax</key>
 		<false/>
+		<key>times1000</key>
+		<false/>
 		<key>command</key>
 		<string>e$waterrise</string>
 		<key>default</key>
@@ -101,6 +89,8 @@
 	<dict>
 		<key>checkOverMax</key>
 		<false/>
+		<key>times1000</key>
+		<false/>
 		<key>command</key>
 		<string>e$healthdec</string>
 		<key>default</key>
@@ -117,6 +107,8 @@
 	<dict>
 		<key>checkOverMax</key>
 		<false/>
+		<key>times1000</key>
+		<false/>
 		<key>command</key>
 		<string>e$ropepct</string>
 		<key>default</key>
@@ -133,6 +125,8 @@
 	<dict>
 		<key>checkOverMax</key>
 		<false/>
+		<key>times1000</key>
+		<false/>
 		<key>command</key>
 		<string>e$casefreq</string>
 		<key>default</key>
@@ -149,6 +143,8 @@
 	<dict>
 		<key>checkOverMax</key>
 		<false/>
+		<key>times1000</key>
+		<false/>
 		<key>command</key>
 		<string>e$healthprob</string>
 		<key>default</key>
@@ -165,6 +161,8 @@
 	<dict>
 		<key>checkOverMax</key>
 		<false/>
+		<key>times1000</key>
+		<false/>
 		<key>command</key>
 		<string>e$hcaseamount</string>
 		<key>default</key>
@@ -181,6 +179,26 @@
 	<dict>
 		<key>checkOverMax</key>
 		<false/>
+		<key>times1000</key>
+		<true/>
+		<key>command</key>
+		<string>e$minestime</string>
+		<key>default</key>
+		<integer>3</integer>
+		<key>image</key>
+		<string>Time</string>
+		<key>max</key>
+		<integer>5</integer>
+		<key>min</key>
+		<integer>-1</integer>
+		<key>title</key>
+		<string>Mines Time</string>
+	</dict>
+	<dict>
+		<key>checkOverMax</key>
+		<false/>
+		<key>times1000</key>
+		<false/>
 		<key>command</key>
 		<string>e$minesnum</string>
 		<key>default</key>
@@ -197,6 +215,8 @@
 	<dict>
 		<key>checkOverMax</key>
 		<false/>
+		<key>times1000</key>
+		<false/>
 		<key>command</key>
 		<string>e$minedudpct</string>
 		<key>default</key>
@@ -213,6 +233,8 @@
 	<dict>
 		<key>checkOverMax</key>
 		<false/>
+		<key>times1000</key>
+		<false/>
 		<key>command</key>
 		<string>e$explosives</string>
 		<key>default</key>