# HG changeset patch # User koda # Date 1278623181 -7200 # Node ID 2c7a9d5aa18cacab6eaacfbb2d079b252ad65874 # Parent 86212d2b116a187c8a794d6131292900811de62e fix static land loading on desktop add further checks to the sporadic init bug on iFoos diff -r 86212d2b116a -r 2c7a9d5aa18c hedgewars/uLand.pas --- a/hedgewars/uLand.pas Thu Jul 08 02:23:10 2010 +0200 +++ b/hedgewars/uLand.pas Thu Jul 08 23:06:21 2010 +0200 @@ -1208,8 +1208,9 @@ LoadThemeConfig; isMap:= false; - if ((GameFlags and gfForts) <> 0) or (Pathz[ptMapCurrent] <> '') then - FillChar(Land,SizeOf(TCollisionArray),0); + // is this not needed any more? let's hope setlength sets also 0s + //if ((GameFlags and gfForts) <> 0) or (Pathz[ptMapCurrent] <> '') then + // FillChar(Land,SizeOf(TCollisionArray),0);*) if (GameFlags and gfForts) = 0 then if Pathz[ptMapCurrent] <> '' then diff -r 86212d2b116a -r 2c7a9d5aa18c project_files/HedgewarsMobile/Classes/GameConfigViewController.m --- a/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Thu Jul 08 02:23:10 2010 +0200 +++ b/project_files/HedgewarsMobile/Classes/GameConfigViewController.m Thu Jul 08 23:06:21 2010 +0200 @@ -143,7 +143,7 @@ return; } - // create the configuration file that is going to be sent to engine + /* NSDictionary *gameDictionary = [[NSDictionary alloc] initWithObjectsAndKeys:mapConfigViewController.seedCommand,@"seed_command", mapConfigViewController.templateFilterCommand,@"templatefilter_command", mapConfigViewController.mapGenCommand,@"mapgen_command", @@ -153,13 +153,36 @@ 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); + } - [[SDLUIKitDelegate sharedAppDelegate] startSDLgame:gameDictionary]; - [gameDictionary release]; - //[[self parentViewController] dismissModalViewControllerAnimated:YES]; } -(void) viewDidLoad {