project_files/HedgewarsMobile/Classes/GameSetup.m
changeset 3926 668b71f31e51
parent 3923 694e6f6e0e30
child 3930 8b00b4f93242
equal deleted inserted replaced
3924:2a9ace189288 3926:668b71f31e51
   121     NSDictionary *ammoData = [[NSDictionary alloc] initWithContentsOfFile:weaponPath];
   121     NSDictionary *ammoData = [[NSDictionary alloc] initWithContentsOfFile:weaponPath];
   122     [weaponPath release];
   122     [weaponPath release];
   123     NSString *update = @"";
   123     NSString *update = @"";
   124 
   124 
   125     // if we're loading an older version of ammos fill the engine message with 0s
   125     // if we're loading an older version of ammos fill the engine message with 0s
   126     int diff = CURRENT_AMMOSIZE - [[ammoData objectForKey:@"version"] intValue];
   126     int diff = HW_getNumberOfWeapons() - [[ammoData objectForKey:@"version"] intValue];
   127     if (diff != 0)
   127     if (diff != 0)
   128         update = [NSString stringWithCharacters:(const unichar*)"0000000000000000000000000000000000" length:diff];
   128         update = [NSString stringWithCharacters:(const unichar*)"0000000000000000000000000000000000" length:diff];
   129 
   129 
   130     NSString *ammloadt = [[NSString alloc] initWithFormat:@"eammloadt %@%@", [ammoData objectForKey:@"ammostore_initialqt"], update];
   130     NSString *ammloadt = [[NSString alloc] initWithFormat:@"eammloadt %@%@", [ammoData objectForKey:@"ammostore_initialqt"], update];
   131     [self sendToEngine: ammloadt];
   131     [self sendToEngine: ammloadt];