project_files/HedgewarsMobile/Classes/MapConfigViewController.m
branchios-revival
changeset 11206 2e80c9861818
parent 11148 064a53861759
child 11226 628ac6f8a41e
--- a/project_files/HedgewarsMobile/Classes/MapConfigViewController.m	Wed Oct 14 02:28:32 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/MapConfigViewController.m	Wed Oct 14 21:25:49 2015 +0200
@@ -62,7 +62,7 @@
     [seed release];
 
     // perform as if user clicked on an entry
-    NSIndexPath *theIndex = [NSIndexPath indexPathForRow:(random()%[source count]) inSection:0];
+    NSIndexPath *theIndex = [NSIndexPath indexPathForRow:arc4random_uniform((int)[source count]) inSection:0];
     [self tableView:self.tableView didSelectRowAtIndexPath:theIndex];
     if (IS_NOT_POWERFUL([HWUtils modelType]) == NO)
         [self.tableView scrollToRowAtIndexPath:theIndex atScrollPosition:UITableViewScrollPositionMiddle animated:YES];
@@ -403,7 +403,6 @@
 
 -(void) viewDidLoad {
     [super viewDidLoad];
-    srandom(time(NULL));
 
     // initialize some "default" values
     self.slider.value = 0.05f;