From a6a0b816c2e5e68d051ece3173bf829f8ae7ffc5 Mon Sep 17 00:00:00 2001 From: masakih Date: Sat, 27 Jun 2015 23:33:48 +0900 Subject: [PATCH] =?utf8?q?=E7=84=A1=E6=84=8F=E5=91=B3=E3=81=AA=E3=83=AD?= =?utf8?q?=E3=82=AF=E3=82=99=E3=81=8B=E3=82=99=E5=87=BA=E5=8A=9B=E3=81=95?= =?utf8?q?=E3=82=8C=E3=81=A6=E3=81=84=E3=81=9F=E3=81=AE=E3=81=A6=E3=82=99?= =?utf8?q?=E4=BF=AE=E6=AD=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- KCD/HMFleetInformation.m | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) diff --git a/KCD/HMFleetInformation.m b/KCD/HMFleetInformation.m index 3ab545b7..328a370b 100644 --- a/KCD/HMFleetInformation.m +++ b/KCD/HMFleetInformation.m @@ -116,12 +116,13 @@ array = [store objectsWithEntityName:@"Ship" error:&error predicateFormat:@"id = %ld", shipId]; + if(array.count == 0) { + NSLog(@"Could not found ship of id %@", shipIdNumber); + } else { + ship = array[0]; + } } - if(shipId != -1 && array.count == 0) { - NSLog(@"Could not found ship of id %@", shipIdNumber); - } else { - ship = array[0]; - } + [self setValue:ship forKey:self.shipNameKeys[shipNumber]]; } - (void)buildFleet @@ -248,14 +249,14 @@ array = [store objectsWithEntityName:@"Ship" error:&error predicateFormat:@"id = %ld", shipId]; + if(array.count == 0) { + NSLog(@"Could not found ship of id %@", shipIdNumber); + } else { + ship = array[0]; + } } else { return 0; } - if(array.count == 0) { - NSLog(@"Could not found ship of id %@", shipIdNumber); - } else { - ship = array[0]; - } if(!ship) return 0; // NSLog(@"ship name -> %@ equipped count -> %ld", ship.name, ship.equippedItem.count); NSArray *effectiveTypes = @[@6, @7, @8, @11]; @@ -349,11 +350,11 @@ array = [store objectsWithEntityName:@"Ship" error:&error predicateFormat:@"id = %ld", shipId]; - } - if(array.count == 0) { - NSLog(@"Could not found ship of id %@", shipIdNumber); - } else { - [result addObject:array[0]]; + if(array.count == 0) { + NSLog(@"Could not found ship of id %@", shipIdNumber); + } else { + [result addObject:array[0]]; + } } } return result; -- 2.11.0