… | |
… | |
40 | if (!(fp = fopen (buf, "w"))) |
40 | if (!(fp = fopen (buf, "w"))) |
41 | { |
41 | { |
42 | LOG (llevError, "Could not open %s for writing\n", buf); |
42 | LOG (llevError, "Could not open %s for writing\n", buf); |
43 | return; |
43 | return; |
44 | } |
44 | } |
|
|
45 | |
45 | for (map = first_map; map != NULL; map = map->next) |
46 | for (map = first_map; map != NULL; map = map->next) |
46 | { |
47 | { |
47 | /* If tmpname is null, it is probably a unique player map, |
48 | /* If tmpname is null, it is probably a unique player map, |
48 | * so don't save information on it. |
49 | * so don't save information on it. |
49 | */ |
50 | */ |
50 | if (map->in_memory != MAP_IN_MEMORY && (map->tmpname != NULL) && (strncmp (map->path, "/random", 7))) |
51 | if (map->in_memory != MAP_IN_MEMORY && map->tmpname) |
51 | { |
52 | { |
52 | /* the 0 written out is a leftover from the lock number for |
53 | /* the 0 written out is a leftover from the lock number for |
53 | * unique items and second one is from encounter maps. |
54 | * unique items and second one is from encounter maps. |
54 | * Keep using it so that old temp files continue |
55 | * Keep using it so that old temp files continue |
55 | * to work. |
56 | * to work. |
56 | */ |
57 | */ |
57 | fprintf (fp, "%s:%s:%ld:0:0:%d:0:%d\n", map->path, map->tmpname, |
58 | fprintf (fp, "%s:%s:%ld:0:0:%d:0:%d\n", map->path, map->tmpname, |
58 | (map->reset_time == (uint32) - 1 ? (long unsigned) -1 : map->reset_time - current_time), map->difficulty, map->darkness); |
59 | (map->reset_time == (uint32) - 1 ? (long unsigned) -1 : map->reset_time - current_time), map->difficulty, map->darkness); |
59 | } |
60 | } |
60 | } |
61 | } |
|
|
62 | |
61 | fclose (fp); |
63 | fclose (fp); |
62 | } |
64 | } |
63 | |
65 | |
64 | void |
66 | void |
65 | read_map_log (void) |
67 | read_map_log (void) |