project_files/HedgewarsMobile/Classes/MainMenuViewController.m
changeset 5483 fc755bb8096d
parent 5224 6e8fbbfb0de5
child 5486 e75f7c3c6275
--- a/project_files/HedgewarsMobile/Classes/MainMenuViewController.m	Sat Jul 30 17:23:47 2011 -0400
+++ b/project_files/HedgewarsMobile/Classes/MainMenuViewController.m	Sun Jul 31 16:03:24 2011 +0200
@@ -27,6 +27,7 @@
 #import "AboutViewController.h"
 #import "SavedGamesViewController.h"
 #import "RestoreViewController.h"
+#import "Appirater.h"
 #import "ServerSetup.h"
 
 @implementation MainMenuViewController
@@ -72,7 +73,7 @@
         [[NSFileManager defaultManager] removeItemAtPath:SCHEMES_DIRECTORY() error:NULL];
     NSString *baseSchemesDir = [[NSString alloc] initWithFormat:@"%@/Settings/Schemes/",resourcesDir];
     [[NSFileManager defaultManager] copyItemAtPath:baseSchemesDir toPath:SCHEMES_DIRECTORY() error:NULL];
-    
+    [baseSchemesDir release];
 
     // WEAPONS - always overwrite
     if ([[NSFileManager defaultManager] fileExistsAtPath:WEAPONS_DIRECTORY()] == NO)
@@ -121,11 +122,15 @@
             [restored release];
         }
         [self performSelector:@selector(presentModalViewController:animated:) withObject:self.restoreViewController afterDelay:0.35];
+    } else {
+        // let's not prompt for rating when app crashed >_>
+        [Appirater appLaunched];
     }
 
+
     /*
     ServerSetup *setup = [[ServerSetup alloc] init];
-    if ([setup isNetworkReachable]) {
+    if (isNetworkReachable()) {
         DLog(@"network is reachable");
         [NSThread detachNewThreadSelector:@selector(serverProtocol)
                                  toTarget:setup