project_files/HedgewarsMobile/Classes/FortsViewController.m
changeset 5982 283be2ca54a7
parent 5208 878e551f0b4a
child 6078 8c0cc07731e5
--- a/project_files/HedgewarsMobile/Classes/FortsViewController.m	Wed Sep 21 15:00:01 2011 -0400
+++ b/project_files/HedgewarsMobile/Classes/FortsViewController.m	Wed Sep 21 22:51:52 2011 +0200
@@ -23,7 +23,7 @@
 #import "CommodityFunctions.h"
 #import "UIImageExtra.h"
 
-#define IMGNUM_PER_FORT 4
+#define IMGNUM_PER_FORT 6
 
 @implementation FortsViewController
 @synthesize teamDictionary, fortArray, lastIndexPath;
@@ -40,10 +40,10 @@
     [super viewDidLoad];
 
     NSArray *directoryContents = [[NSFileManager defaultManager] contentsOfDirectoryAtPath:FORTS_DIRECTORY() error:NULL];
-    NSMutableArray *filteredContents = [[NSMutableArray alloc] initWithCapacity:([directoryContents count] / 3)];
+    NSMutableArray *filteredContents = [[NSMutableArray alloc] initWithCapacity:([directoryContents count] / IMGNUM_PER_FORT)];
     // we need to remove the double entries and the L.png suffix
     for (int i = 0; i < [directoryContents count]; i++) {
-        if (i % IMGNUM_PER_FORT == 3) {
+        if (i % IMGNUM_PER_FORT == IMGNUM_PER_FORT-1) {
             NSString *currentName = [directoryContents objectAtIndex:i];
             NSString *correctName = [currentName substringToIndex:([currentName length] - 5)];
             [filteredContents addObject:correctName];