project_files/HedgewarsMobile/Classes/LevelViewController.m
branchios-revival
changeset 11210 2e80c9861818
parent 11148 064a53861759
child 11221 e68b3e392091
--- a/project_files/HedgewarsMobile/Classes/LevelViewController.m	Wed Oct 14 02:28:32 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/LevelViewController.m	Wed Oct 14 21:25:49 2015 +0200
@@ -31,7 +31,6 @@
 #pragma mark View lifecycle
 -(void) viewDidLoad {
     [super viewDidLoad];
-    srandom(time(NULL));
 
     NSArray *array = [[NSArray alloc] initWithObjects:
                       NSLocalizedString(@"Brutal",@""),
@@ -133,7 +132,7 @@
     if (theSwitch.on) {
         numberOfSections = 2;
         [self.tableView insertSections:sections withRowAnimation:UITableViewRowAnimationFade];
-        level = 1 + (random() % ([levelArray count] - 1));
+        level = 1 + arc4random_uniform((int)[levelArray count] - 1);
     } else {
         numberOfSections = 1;
         [self.tableView deleteSections:sections withRowAnimation:UITableViewRowAnimationFade];