fix land check fo' real
authorkoda
Sat, 10 Jul 2010 02:02:37 +0200
changeset 3632 8e1bd8b5780e
parent 3631 159bc2fd7f68
child 3633 130c24d74043
child 3634 93d260c96635
fix land check fo' real more logs in case of failing gameConfig
hedgewars/uLand.pas
project_files/HedgewarsMobile/Classes/GameConfigViewController.m
--- a/hedgewars/uLand.pas	Thu Jul 08 23:34:25 2010 +0200
+++ b/hedgewars/uLand.pas	Sat Jul 10 02:02:37 2010 +0200
@@ -66,10 +66,11 @@
 
 procedure LogLandDigest;
 var s: shortstring;
-    adler: LongInt;
+    adler, i, tmp: LongInt;
 begin
 adler:= 1;
-Adler32Update(adler, @Land[0,0], sizeof(Land));
+for i:= 0 to LAND_HEIGHT-1 do
+    Adler32Update(adler, @Land[i,0], LAND_WIDTH);
 s:= 'M'+inttostr(adler);
 
 CheckLandDigest(s);
--- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Thu Jul 08 23:34:25 2010 +0200
+++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m	Sat Jul 10 02:02:37 2010 +0200
@@ -143,8 +143,8 @@
         return;
     }
     
-    /*
-    NSDictionary *gameDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:mapConfigViewController.seedCommand,@"seed_command",
+    // create the configuration file that is going to be sent to engine
+    NSDictionary *gameDictionary = [NSDictionary dictionaryWithObjectsAndKeys:mapConfigViewController.seedCommand,@"seed_command",
                                                                       mapConfigViewController.templateFilterCommand,@"templatefilter_command",
                                                                       mapConfigViewController.mapGenCommand,@"mapgen_command",
                                                                       mapConfigViewController.mazeSizeCommand,@"mazesize_command",
@@ -153,34 +153,15 @@
                                                                       schemeWeaponConfigViewController.selectedScheme,@"scheme",
                                                                       schemeWeaponConfigViewController.selectedWeapon,@"weapon",
                                                                       nil];
-    */
     
-    // create the configuration file that is going to be sent to engine
-    NSDictionary *gameDictionary = [NSDictionary dictionaryWithObjects:[NSArray arrayWithObjects:
-                                                                        mapConfigViewController.seedCommand,
-                                                                        mapConfigViewController.templateFilterCommand,
-                                                                        mapConfigViewController.mapGenCommand,
-                                                                        mapConfigViewController.mazeSizeCommand,
-                                                                        mapConfigViewController.themeCommand,
-                                                                        teamConfigViewController.listOfSelectedTeams,
-                                                                        schemeWeaponConfigViewController.selectedScheme,
-                                                                        schemeWeaponConfigViewController.selectedWeapon,nil]
-                                                               forKeys:[NSArray arrayWithObjects:
-                                                                        @"seed_command",
-                                                                        @"templatefilter_command",
-                                                                        @"mapgen_command",
-                                                                        @"mazesize_command",
-                                                                        @"theme_command",
-                                                                        @"teams_list",
-                                                                        @"scheme",
-                                                                        @"weapon",nil]];
     // finally launch game and remove this controller
     DLog(@"sending config %@", gameDictionary);
     
     if ([[gameDictionary allKeys] count] == 8) {
         [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:gameDictionary];
     } else {
-        DLog(@"gameconfig data not complete\n%@\nWHY???", gameDictionary);
+        DLog(@"gameconfig data not complete!!\nmapConfigViewController = %@\nteamConfigViewController = %@\nschemeWeaponConfigViewController = %@\n",
+             mapConfigViewController, teamConfigViewController, schemeWeaponConfigViewController);
     }
 
 }