kleinere fixes am autoseeding. aber cih glaube irgendwie nicht, dem ganzen auf den grund gekommen zu sein...

This commit is contained in:
Enno Rehling 2002-05-01 23:47:32 +00:00
parent cefa3e61bb
commit 2171245196
7 changed files with 46 additions and 36 deletions

View File

@ -2348,14 +2348,14 @@ strdup(const char *s)
#endif
void
remove_empty_factions(void)
remove_empty_factions(boolean writedropouts)
{
faction **fp, *f3;
FILE *dofp;
FILE *dofp = NULL;
char zText[MAX_PATH];
sprintf(zText, "%s/dropouts.%d", basepath(), turn);
dofp = fopen(zText, "w");
if (writedropouts) dofp = fopen(zText, "w");
for (fp = &factions; *fp;) {
faction * f = *fp;
@ -2370,7 +2370,7 @@ remove_empty_factions(void)
/* Einfach in eine Datei schreiben und später vermailen */
fprintf(dofp, "%s %s %d %d %d\n", f->email, rc_name(f->race, 0), f->age, ur?ur->x:0, ur?ur->y:0);
if (dofp) fprintf(dofp, "%s %s %d %d %d\n", f->email, LOC(default_locale, rc_name(f->race, 0)), f->age, ur?ur->x:0, ur?ur->y:0);
if (updatelog) fprintf(updatelog, "dropout %s\n", itoa36(f->no));
for (f3 = factions; f3; f3 = f3->next) {
@ -2409,7 +2409,7 @@ remove_empty_factions(void)
else fp = &(*fp)->next;
}
fclose(dofp);
if (dofp) fclose(dofp);
}
void

View File

@ -844,7 +844,7 @@ typedef struct ally {
void remove_empty_units_in_region(struct region *r);
void remove_empty_units(void);
void remove_empty_factions(void);
void remove_empty_factions(boolean writedropouts);
typedef struct strlist {
struct strlist *next;

View File

@ -1042,7 +1042,7 @@ readgame(boolean backup)
findfaction(0)->alive = 1;
}
if (maxregions>=0) {
remove_empty_factions();
remove_empty_factions(false);
}
/* Regionen */

View File

@ -283,7 +283,7 @@ processturn(char *filename)
if (!noreports) reports();
free_units();
puts(" - Beseitige leere Parteien");
remove_empty_factions();
remove_empty_factions(true);
end = make_summary(true);
report_summary(end, begin, false);
report_summary(end, begin, true);

View File

@ -163,7 +163,7 @@ give_latestart_bonus(region *r, unit *u, int b)
dropout * dropouts = NULL;
void
int
read_orders_file(const char * filename)
{
faction * f = NULL;
@ -171,7 +171,7 @@ read_orders_file(const char * filename)
char buffer[16];
FILE * F = fopen(filename, "r");
if (F==NULL) return;
if (F==NULL) return -1;
b = getbuf(F);
@ -191,12 +191,14 @@ read_orders_file(const char * filename)
b = getbuf(F);
}
fclose(F);
return 0;
}
void
read_orders(const char * filename)
{
faction *f;
boolean loaded = false;
#ifdef __USE_POSIX /* if filename points to a directory, read
all files it contains. */
@ -213,14 +215,14 @@ read_orders(const char * filename)
}
closedir(dir);
} else {
read_orders_file(filename);
if (read_orders_file(filename)==0) loaded = true;
}
}
#else /* we do not have this functionality */
read_orders_file(filename);
if (read_orders_file(filename)==0) loaded=true;
#endif
for (f=factions;f;f=f->next) {
if (loaded) for (f=factions;f;f=f->next) {
if (!fval(f, FL_MARK) && f->age <=1) {
ursprung * ur = f->ursprung;
while (ur && ur->id!=0) ur=ur->next;
@ -250,7 +252,7 @@ read_dropouts(const char * filename)
char email[64], race[20];
int age, x, y;
if (fscanf(F, "%s %s %d %d %d", email, race, &age, &x, &y)<=0) break;
if (age<=1) {
if (age<=2) {
region * r = findregion(x, y);
if (r) {
dropout * drop = calloc(sizeof(dropout), 1);

View File

@ -1072,7 +1072,7 @@ movearound(int rx, int ry) {
ch = -9;
break;
case 'P':
NeuePartei(r);
if (r) NeuePartei(r);
ch = -9;
break;
case 'X':
@ -1096,7 +1096,7 @@ movearound(int rx, int ry) {
break;
case 'u':
case 'e':
while (showunits(r));
while (r && showunits(r));
ch = -9;
break;
case 'U':
@ -1573,8 +1573,10 @@ main(int argc, char *argv[])
read_newfactions(buf);
sprintf(buf, "%s/dropouts.%d", basepath(), turn);
read_dropouts(buf);
if (orderfile) {
sprintf(buf, "%s/%s", basepath(), orderfile);
read_orders(buf);
}
if (findfaction(MONSTER_FACTION)==NULL) {
makemonsters();

View File

@ -3433,31 +3433,37 @@
<namespace name="spellinfo">
<string name="blessedharvest">
<text locale="de">Dieses Ernteritual verbessert die
Erträge der arbeitenden Bauern in der Region um ein
Silberstück. Je mehr Kraft der Druide investiert,
desto länger wirkt der Zauber.</text>
Erträge der arbeitenden Bauern in der Region
um ein Silberstück. Je mehr Kraft der Druide
investiert, desto länger wirkt der
Zauber.</text>
<text locale="en">This harvest ritual increases the
income of each working peasant by one silver piece.
The more power the druid invests, the longer the spell
lasts.</text>
income of each working peasant by one silver
piece. The more power the druid invests, the
longer the spell lasts.</text>
</string>
<string name="veterinarian">
<text locale="de">Die Fähigkeiten der Gwyrrd-Magier in
der Viehzucht und Heilung sind bei den Bauern sehr
begehrt. Grade auf Märkten sind ihre Dienste häufig
sehr gefragt. Manch einer mag auch sein Talent dazu
nutzen, ein Tier für einen besseren Preis zu
verkaufen. Pro Stufe kann der Magier so 50 Silber
verdienen.</text>
der Viehzucht und Heilung sind bei den Bauern
sehr begehrt. Grade auf Märkten sind ihre
Dienste häufig sehr gefragt. Manch einer mag
auch sein Talent dazu nutzen, ein Tier für
einen besseren Preis zu verkaufen. Pro Stufe
kann der Magier so 50 Silber verdienen.</text>
<text locale="en">The abilities of the mages of Gwyrrd
concerning the breeding and healing of cattle are
highly appreciated among the peasants. Especially at
the markets, their services are demanded frequently.
Some of them also use their talents to sell an animal
at a higher price. A mage can earn 50 silver pieces
per level in this way.</text>
concerning the breeding and healing of cattle
are highly appreciated among the peasants.
Especially at the markets, their services are
demanded frequently. Some of them also use
their talents to sell an animal at a higher
price. A mage can earn 50 silver pieces per
level in this way.</text>
</string>
</namespace>
</strings>