writegame schreib das datenfile in den falschen folder

This commit is contained in:
Enno Rehling 2003-12-28 10:54:47 +00:00
parent 3298e06f7c
commit b7dde0bcf0
4 changed files with 7 additions and 8 deletions

View File

@ -1303,7 +1303,7 @@ export_players(const char * path)
} }
#endif #endif
void int
writegame(const char *filename, char quiet) writegame(const char *filename, char quiet)
{ {
int i,n; int i,n;
@ -1325,10 +1325,9 @@ writegame(const char *filename, char quiet)
/* write_dynamictypes(); */ /* write_dynamictypes(); */
sprintf(buf, "%s/%s", datapath(), filename); F = cfopen(filename, "w");
F = cfopen(buf, "w");
if (F==NULL) if (F==NULL)
return; return -1;
if (!quiet) if (!quiet)
printf("Schreibe die %d. Runde...\n", turn); printf("Schreibe die %d. Runde...\n", turn);
@ -1458,6 +1457,7 @@ writegame(const char *filename, char quiet)
#endif #endif
fclose(F); fclose(F);
printf("\nOk.\n"); printf("\nOk.\n");
return 0;
} }
/* ------------------------------------------------------------- */ /* ------------------------------------------------------------- */

View File

@ -37,7 +37,7 @@ FILE * cfopen(const char *filename, const char *mode);
int readorders(const char *); int readorders(const char *);
int creategame(void); int creategame(void);
extern int readgame(const char * filename, int backup); extern int readgame(const char * filename, int backup);
void writegame(const char *filename, char quiet); int writegame(const char *filename, char quiet);
extern void rsf(FILE * F, char *s, size_t len); extern void rsf(FILE * F, char *s, size_t len);

View File

@ -51,8 +51,7 @@ write_game(const char *filename)
free_units(); free_units();
remove_empty_factions(true); remove_empty_factions(true);
writegame(filename, 0); return writegame(filename, 0);
return 0;
} }
extern int writepasswd(void); extern int writepasswd(void);

View File

@ -344,7 +344,7 @@ processturn(char *filename)
if (!nowrite) { if (!nowrite) {
char ztext[64]; char ztext[64];
sprintf(ztext, "%s/%d", datapath(), turn); sprintf(ztext, "%s/%d", datapath(), turn);
writegame(ztext, 0); return writegame(ztext, 0);
} }
return 0; return 0;
} }