- Aktuelle Rundennummer in Datei 'turn'.

This commit is contained in:
Christian Schlittchen 2002-11-03 08:39:04 +00:00
parent 61e75a0708
commit 4547866348
2 changed files with 11 additions and 1 deletions

View File

@ -657,8 +657,10 @@ build(unit * u, const construction * ctype, int completed, int want)
}
}
if (want>0)
if (want>0) {
n = min(want, n);
}
if (type->maxsize>0) {
n = min(type->maxsize-completed, n);
if (type->improvement==NULL) {

View File

@ -1294,12 +1294,20 @@ writegame(char *path, char quiet)
FILE * F;
#ifdef USE_PLAYERS
char playerfile[MAX_PATH];
#endif
#ifdef USE_PLAYERS
sprintf(buf, "%s/%d.players", datapath(), turn);
export_players(playerfile);
#endif
/* write_dynamictypes(); */
/* write turn number to file for use by external scripts */
F = fopen("turn","w");
fprintf(F, "%d", turn);
fclose(F);
F = cfopen(path, "w");
if (F==NULL)
return;