project_files/HedgewarsMobile/Classes/GameSetup.m
changeset 3523 6592fbb969da
parent 3522 156c04c6a3d8
child 3535 9e78c1f3d8d8
equal deleted inserted replaced
3522:156c04c6a3d8 3523:6592fbb969da
   101 }
   101 }
   102 
   102 
   103 // unpacks ammostore data from the selected ammo.plist to a sequence of engine commands
   103 // unpacks ammostore data from the selected ammo.plist to a sequence of engine commands
   104 -(void) provideAmmoData:(NSString *)ammostoreName forPlayingTeams:(NSInteger) numberOfTeams {
   104 -(void) provideAmmoData:(NSString *)ammostoreName forPlayingTeams:(NSInteger) numberOfTeams {
   105     NSString *weaponPath = [[NSString alloc] initWithFormat:@"%@/%@",WEAPONS_DIRECTORY(),ammostoreName];
   105     NSString *weaponPath = [[NSString alloc] initWithFormat:@"%@/%@",WEAPONS_DIRECTORY(),ammostoreName];
   106     NSDictionary *ammoData = [[NSDictionary alloc] initWithContentsOfFile:ammoDataFile];
   106     NSDictionary *ammoData = [[NSDictionary alloc] initWithContentsOfFile:weaponPath];
   107     [weaponPath release];
   107     [weaponPath release];
   108     
   108     
   109     NSString *ammloadt = [[NSString alloc] initWithFormat:@"eammloadt %@", [ammoData objectForKey:@"ammostore_initialqt"]];
   109     NSString *ammloadt = [[NSString alloc] initWithFormat:@"eammloadt %@", [ammoData objectForKey:@"ammostore_initialqt"]];
   110     [self sendToEngine: ammloadt];
   110     [self sendToEngine: ammloadt];
   111     [ammloadt release];
   111     [ammloadt release];
   304                                   forHogs:[[teamData objectForKey:@"number"] intValue]
   304                                   forHogs:[[teamData objectForKey:@"number"] intValue]
   305                                withHealth:health
   305                                withHealth:health
   306                                   ofColor:[teamData objectForKey:@"color"]];
   306                                   ofColor:[teamData objectForKey:@"color"]];
   307                 }
   307                 }
   308                 
   308                 
   309                 [self provideAmmoData:@"Default" forPlayingTeams:[teamsConfig count]];
   309                 [self provideAmmoData:@"Default.plist" forPlayingTeams:[teamsConfig count]];
   310                 
   310                 
   311                 clientQuit = NO;
   311                 clientQuit = NO;
   312 			} else {
   312 			} else {
   313 				DLog(@"wrong message or client closed connection");
   313 				DLog(@"wrong message or client closed connection");
   314 				clientQuit = YES;
   314 				clientQuit = YES;