- First attempt to fix crashes on loading 'Styles' ios-revival
authorantonc27 <antonc27@mail.ru>
Thu, 10 Sep 2015 01:31:52 +0200
branchios-revival
changeset 11147 f9c460720e02
parent 11146 f5e552f97eda
child 11148 064a53861759
- First attempt to fix crashes on loading 'Styles'
project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m
--- a/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Sun Sep 06 04:30:30 2015 +0200
+++ b/project_files/HedgewarsMobile/Classes/SchemeWeaponConfigViewController.m	Thu Sep 10 01:31:52 2015 +0200
@@ -322,20 +322,32 @@
 
             self.scriptCommand = [NSString stringWithFormat:@"escript Scripts/Multiplayer/%@",self.selectedScript];
             NSString *scheme = [scriptOptions objectAtIndex:0];
-            if ([scheme isEqualToString:@"locked"]) {
+            if ([scheme isEqualToString:@"locked"])
+            {
                 self.selectedScheme = @"Default.plist";
                 [self.topControl setEnabled:NO forSegmentAtIndex:0];
-            } else {
-                self.selectedScheme = [NSString stringWithFormat:@"%@.plist",scheme];
+            }
+            else
+            {
+                if (![scheme isEqualToString:@"*"])
+                {
+                    self.selectedScheme = [NSString stringWithFormat:@"%@.plist",scheme];
+                }
                 [self.topControl setEnabled:YES forSegmentAtIndex:0];
             }
 
             NSString *weapon = [scriptOptions objectAtIndex:1];
-            if ([weapon isEqualToString:@"locked"]) {
+            if ([weapon isEqualToString:@"locked"])
+            {
                 self.selectedWeapon = @"Default.plist";
                 [self.topControl setEnabled:NO forSegmentAtIndex:1];
-            } else {
-                self.selectedWeapon = [NSString stringWithFormat:@"%@.plist",weapon];
+            }
+            else
+            {
+                if (![weapon isEqualToString:@"*"])
+                {
+                    self.selectedWeapon = [NSString stringWithFormat:@"%@.plist",weapon];
+                }
                 [self.topControl setEnabled:YES forSegmentAtIndex:1];
             }
         }