--- savegame.c.orig Wed Jan 16 23:41:19 2002 +++ savegame.c Wed Jan 16 23:22:04 2002 @@ -361,6 +361,8 @@ map.fixed_start_positions = 0; } + + /* get 4-bit segments of 16-bit "special" field. */ LOAD_MAP_DATA(secfile_lookup_str(file, "map.l%03d", y), map_get_tile(x, y)->special = ascii_hex2bin(ch, 0)); @@ -368,35 +370,39 @@ map_get_tile(x, y)->special |= ascii_hex2bin(ch, 1)); LOAD_MAP_DATA(secfile_lookup_str_default(file, NULL, "map.n%03d", y), map_get_tile(x, y)->special |= ascii_hex2bin(ch, 2)); - LOAD_MAP_DATA(secfile_lookup_str_default(file, NULL, "map.f%03d", y), - map_get_tile(x, y)->special |= ascii_hex2bin(ch, 3)); - if (secfile_lookup_int_default(file, 1, "game.save_known") - && game.load_options.load_known) { + /* this data is missing in a new game with just map and + * starting positions, but that's ok */ + if(!game.is_new_game) { + LOAD_MAP_DATA(secfile_lookup_str_default(file, NULL, "map.f%03d", y), + map_get_tile(x, y)->special |= ascii_hex2bin(ch, 3)); + + if (secfile_lookup_int_default(file, 1, "game.save_known") + && game.load_options.load_known) { - /* get 4-bit segments of the first half of the 32-bit "known" field */ - LOAD_MAP_DATA(secfile_lookup_str(file, "map.a%03d", y), - map_get_tile(x, y)->known = ascii_hex2bin(ch, 0)); - LOAD_MAP_DATA(secfile_lookup_str(file, "map.b%03d", y), - map_get_tile(x, y)->known |= ascii_hex2bin(ch, 1)); - LOAD_MAP_DATA(secfile_lookup_str(file, "map.c%03d", y), - map_get_tile(x, y)->known |= ascii_hex2bin(ch, 2)); - LOAD_MAP_DATA(secfile_lookup_str(file, "map.d%03d", y), - map_get_tile(x, y)->known |= ascii_hex2bin(ch, 3)); + /* get 4-bit segments of the first half of the 32-bit "known" field */ + LOAD_MAP_DATA(secfile_lookup_str(file, "map.a%03d", y), + map_get_tile(x, y)->known = ascii_hex2bin(ch, 0)); + LOAD_MAP_DATA(secfile_lookup_str(file, "map.b%03d", y), + map_get_tile(x, y)->known |= ascii_hex2bin(ch, 1)); + LOAD_MAP_DATA(secfile_lookup_str(file, "map.c%03d", y), + map_get_tile(x, y)->known |= ascii_hex2bin(ch, 2)); + LOAD_MAP_DATA(secfile_lookup_str(file, "map.d%03d", y), + map_get_tile(x, y)->known |= ascii_hex2bin(ch, 3)); - if (has_capability("known32fix", savefile_options)) { - /* get 4-bit segments of the second half of the 32-bit "known" field */ - LOAD_MAP_DATA(secfile_lookup_str(file, "map.e%03d", y), - map_get_tile(x, y)->known |= ascii_hex2bin(ch, 4)); - LOAD_MAP_DATA(secfile_lookup_str(file, "map.g%03d", y), - map_get_tile(x, y)->known |= ascii_hex2bin(ch, 5)); - LOAD_MAP_DATA(secfile_lookup_str(file, "map.h%03d", y), - map_get_tile(x, y)->known |= ascii_hex2bin(ch, 6)); - LOAD_MAP_DATA(secfile_lookup_str(file, "map.i%03d", y), - map_get_tile(x, y)->known |= ascii_hex2bin(ch, 7)); + if (has_capability("known32fix", savefile_options)) { + /* get 4-bit segments of the second half of the 32-bit "known" field */ + LOAD_MAP_DATA(secfile_lookup_str(file, "map.e%03d", y), + map_get_tile(x, y)->known |= ascii_hex2bin(ch, 4)); + LOAD_MAP_DATA(secfile_lookup_str(file, "map.g%03d", y), + map_get_tile(x, y)->known |= ascii_hex2bin(ch, 5)); + LOAD_MAP_DATA(secfile_lookup_str(file, "map.h%03d", y), + map_get_tile(x, y)->known |= ascii_hex2bin(ch, 6)); + LOAD_MAP_DATA(secfile_lookup_str(file, "map.i%03d", y), + map_get_tile(x, y)->known |= ascii_hex2bin(ch, 7)); + } } } - map.have_specials = 1;