project_files/HedgewarsMobile/Classes/VoicesViewController.m
branchios-revival
changeset 11206 2e80c9861818
parent 11148 064a53861759
child 12872 00215a7ec5f5
--- a/project_files/HedgewarsMobile/Classes/VoicesViewController.m	Wed Oct 14 02:28:32 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/VoicesViewController.m	Wed Oct 14 21:25:49 2015 +0200
@@ -32,7 +32,6 @@
 #pragma mark View lifecycle
 -(void) viewDidLoad {
     [super viewDidLoad];
-    srandom(time(NULL));
 
     voiceBeingPlayed = NULL;
 
@@ -129,7 +128,7 @@
     NSString *voiceDir = [[NSString alloc] initWithFormat:@"%@/%@/",VOICES_DIRECTORY(),[voiceArray objectAtIndex:newRow]];
     NSArray *array = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:voiceDir error:NULL];
 
-    int index = random() % [array count];
+    int index = arc4random_uniform((int)[array count]);
 
     voiceBeingPlayed = Mix_LoadWAV([[voiceDir stringByAppendingString:[array objectAtIndex:index]] UTF8String]);
     [voiceDir release];