diff --git a/src/common/kernel/eressea.c b/src/common/kernel/eressea.c index a68dbdf71..04ebd0989 100644 --- a/src/common/kernel/eressea.c +++ b/src/common/kernel/eressea.c @@ -2427,8 +2427,8 @@ remove_empty_units_in_region(region *r) while (*up) { unit * u = *up; - faction * f = u->faction; #ifdef MAXAGE + faction * f = u->faction; if (f->age > MAXAGE) set_number(u, 0); #endif if ((u->number <= 0 && u->race != new_race[RC_SPELL]) diff --git a/src/common/kernel/race.c b/src/common/kernel/race.c index 84ca6ac67..5a9bb31a2 100644 --- a/src/common/kernel/race.c +++ b/src/common/kernel/race.c @@ -284,9 +284,9 @@ unit_max_hp(const unit * u) { int h; double p; + static const curse_type * heal_ct = NULL; h = u->race->hitpoints; - static const curse_type * heal_ct; - heal_ct = ct_find("healingzone"); + if (heal_ct==NULL) heal_ct = ct_find("healingzone"); p = pow(effskill(u, SK_AUSDAUER) / 2.0, 1.5) * 0.2; diff --git a/src/common/kernel/spell.c b/src/common/kernel/spell.c index 63da80837..2bd1d9cde 100644 --- a/src/common/kernel/spell.c +++ b/src/common/kernel/spell.c @@ -4955,6 +4955,7 @@ sp_depression(castorder *co) return cast_level; } +#if 0 /* ------------------------------------------------------------- */ /* Name: Hoher Gesang der Drachen * Stufe: 14 @@ -4969,7 +4970,6 @@ sp_depression(castorder *co) * (FARCASTING | REGIONSPELL | TESTRESISTANCE) */ /* TODO zur Aktivierung in Zauberliste aufnehmen*/ - static int sp_dragonsong(castorder *co) { @@ -5043,7 +5043,7 @@ sp_songofAttraction(castorder *co) return cast_level; } - +#endif /* ------------------------------------------------------------- */ /* TRAUM - Illaun */ diff --git a/src/common/spells/buildingcurse.c b/src/common/spells/buildingcurse.c index 552a467ac..daaaf96e7 100644 --- a/src/common/spells/buildingcurse.c +++ b/src/common/spells/buildingcurse.c @@ -34,7 +34,7 @@ int -cinfo_building(const locale * lang, void * obj, typ_t typ, curse *c, int self) +cinfo_building(const locale * lang, const void * obj, typ_t typ, curse *c, int self) { message * msg; @@ -55,7 +55,7 @@ cinfo_building(const locale * lang, void * obj, typ_t typ, curse *c, int self) /* C_MAGICWALLS*/ static int -cinfo_magicrunes(void * obj, typ_t typ, curse *c, int self) +cinfo_magicrunes(const struct locale* lang, const void * obj, typ_t typ, curse *c, int self) { if (typ == TYP_BUILDING){ diff --git a/src/common/spells/buildingcurse.h b/src/common/spells/buildingcurse.h index 12c9e3ae3..33cfa8912 100644 --- a/src/common/spells/buildingcurse.h +++ b/src/common/spells/buildingcurse.h @@ -16,7 +16,7 @@ struct locale; struct curse; -extern int cinfo_building(const struct locale * lang, void * obj, typ_t typ, struct curse *c, int self); +extern int cinfo_building(const struct locale * lang, const void * obj, typ_t typ, struct curse *c, int self); extern void register_buildingcurse(void); diff --git a/src/mapper/autoseed.c b/src/mapper/autoseed.c index 72b1dc027..db36655aa 100644 --- a/src/mapper/autoseed.c +++ b/src/mapper/autoseed.c @@ -16,6 +16,7 @@ /* kernel includes */ #include +#include #include #include #include @@ -277,21 +278,44 @@ preferred_terrain(const struct race * rc) #define REGIONS_PER_FACTION 2 #define MINFACTIONS 1 -void +int mkisland(int nsize) { - int x, y; + int x = 0, y = 0; region * r; regionlist * rlist = NULL; - int rsize; - - if (listlen(newfactions)next) { + struct plane * p = rplane(r); + if (p==NULL && (rmin==NULL || r->age<=rmin->age)) rmin=r; + } + r = NULL; + for (dist=1;r!=rmin;++dist) { + for (d=0;r!=rmin && d!=MAXDIRECTIONS;++d) { + int i; + region * rn = rmin; + for (i=0;i!=dist;++i) rn=rconnect(rn, d); + if (rn==NULL) { + r = rmin; + x = rmin->x + delta_x[d] * dist; + y = rmin->y + delta_y[d] * dist; + } + } + } +#endif + if (listlen(newfactions)race)); + ++isize; u = addplayer(r, nextf->email, nextf->password, nextf->race, nextf->lang); /* remove duplicate email addresses */ @@ -336,5 +361,28 @@ mkisland(int nsize) } } } -} + if (rlist) { + regionlist ** rbegin = &rlist; + int i; +#define MINOCEANDIST 3 + for (i=0;i!=MINOCEANDIST;++i) { + regionlist ** rend = rbegin; + while (*rend) rend=&(*rend)->next; + while (rbegin!=rend) { + direction_t d; + region * r = (*rbegin)->region; + rbegin=&(*rbegin)->next; + for (d=0;d!=MAXDIRECTIONS;++d) { + region * rn = rconnect(r, d); + if (rn==NULL) { + rn = new_region(r->x + delta_x[d], r->y + delta_y[d]); + terraform(rn, T_OCEAN); + add_regionlist(rend, rn); + } + } + } + } + } + return isize; +} diff --git a/src/mapper/autoseed.h b/src/mapper/autoseed.h index 09136382d..4827a4f7d 100644 --- a/src/mapper/autoseed.h +++ b/src/mapper/autoseed.h @@ -30,6 +30,6 @@ extern newfaction * newfactions; extern void autoseed(struct regionlist * rlist); extern void get_island(struct regionlist ** rlist); -extern void mkisland(int nsize); +extern int mkisland(int nsize); #endif diff --git a/src/mapper/mapper.c b/src/mapper/mapper.c index a3c35bea4..29f19f45e 100644 --- a/src/mapper/mapper.c +++ b/src/mapper/mapper.c @@ -12,6 +12,7 @@ */ #define VERSION "3.3.0" +#define ISLANDSIZE 20 #define MAIN_C #define BOOL_DEFINED @@ -1052,7 +1053,7 @@ movearound(int rx, int ry) { modified = 1; break; case 'm': - mkisland(20); + mkisland(ISLANDSIZE); modified = 1; break; case 'S': @@ -1593,7 +1594,7 @@ main(int argc, char *argv[]) if (autoseeding) { while (newfactions) { int n = listlen(newfactions); - int k = (n+19)/20; + int k = (n+ISLANDSIZE-1)/ISLANDSIZE; k = n / k; mkisland(k); }