diff --git a/src/common/kernel/build.c b/src/common/kernel/build.c index f6cfe7532..eeea27323 100644 --- a/src/common/kernel/build.c +++ b/src/common/kernel/build.c @@ -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) { diff --git a/src/common/kernel/save.c b/src/common/kernel/save.c index 8abe6ca20..1210c9a75 100644 --- a/src/common/kernel/save.c +++ b/src/common/kernel/save.c @@ -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;