1 | /* |
1 | /* |
2 | * static char *rcsid_map_c = |
2 | * static char *rcsid_map_c = |
3 | * "$Id: map.C,v 1.4 2006/08/15 18:12:20 elmex Exp $"; |
3 | * "$Id: map.C,v 1.5 2006/08/20 20:57:34 elmex Exp $"; |
4 | */ |
4 | */ |
5 | |
5 | |
6 | /* |
6 | /* |
7 | CrossFire, A Multiplayer game for X-windows |
7 | CrossFire, A Multiplayer game for X-windows |
8 | |
8 | |
… | |
… | |
1330 | * player) |
1330 | * player) |
1331 | */ |
1331 | */ |
1332 | fp2 = fp; /* save unique items into fp2 */ |
1332 | fp2 = fp; /* save unique items into fp2 */ |
1333 | if ((flag == 0 || flag == 2) && !m->unique && !m->templatemap) { |
1333 | if ((flag == 0 || flag == 2) && !m->unique && !m->templatemap) { |
1334 | sprintf (buf,"%s.v00",create_items_path (m->path)); |
1334 | sprintf (buf,"%s.v00",create_items_path (m->path)); |
|
|
1335 | unlink (buf); // unlink here too, so that we have backups when using hard links |
1335 | if ((fp2 = fopen (buf, "w")) == NULL) { |
1336 | if ((fp2 = fopen (buf, "w")) == NULL) { |
1336 | LOG(llevError, "Can't open unique items file %s\n", buf); |
1337 | LOG(llevError, "Can't open unique items file %s\n", buf); |
1337 | } |
1338 | } |
1338 | if (flag == 2) |
1339 | if (flag == 2) |
1339 | save_objects(m, fp, fp2, 2); |
1340 | save_objects(m, fp, fp2, 2); |