- Fix Phönix-respawn

- Kleine Hilfsoperationen im mapper
This commit is contained in:
Christian Schlittchen 2003-12-15 19:33:16 +00:00
parent 3ddedb8a0d
commit ff27aed2fb
2 changed files with 30 additions and 5 deletions

View File

@ -2820,7 +2820,7 @@ random_region(void)
/* count the available regions */ /* count the available regions */
for(r=regions; r; r=r->next) { for(r=regions; r; r=r->next) {
if(rplane(r) == NULL) c++; if(rplane(r) == NULL && landregion(r)) c++;
} }
/* choose one */ /* choose one */
@ -2828,7 +2828,9 @@ random_region(void)
/* this is a bit obfuscated, but should be correct */ /* this is a bit obfuscated, but should be correct */
for(r=regions; c > 0; r=r->next) { for(r=regions; c > 0; r=r->next) {
--c; if(rplane(r) == NULL && landregion(r)) {
--c;
}
} }
return(r); return(r);
@ -2854,7 +2856,7 @@ check_phoenix(void)
} }
/* it is not, so we create it */ /* it is not, so we create it */
r = random_region(); r = random_land_region();
phoenix = createunit(r, findfaction(MONSTER_FACTION), 1, phoenix_race); phoenix = createunit(r, findfaction(MONSTER_FACTION), 1, phoenix_race);
/* generate an appropriate region message */ /* generate an appropriate region message */

View File

@ -643,9 +643,9 @@ modify_block(void)
int mal = 0; int mal = 0;
struct rawmaterial *res; struct rawmaterial *res;
win = openwin(70, 4, "< Tag-Regionen modifizieren >"); win = openwin(90, 4, "< Tag-Regionen modifizieren >");
wmove(win, 1, 2); wmove(win, 1, 2);
wAddstr("Name, Peasants, Horses, Silver, Chaos, noResources, Mallorn (n/p/h/s/c/r/m,q)?"); wAddstr("Empty, Name, Peasants, Horses, Silver, Chaos, noResources, Mallorn (e/n/p/h/s/c/r/m,q)?");
wrefresh(win); wrefresh(win);
c = getch(); c = getch();
if (c == 'q') { if (c == 'q') {
@ -686,6 +686,29 @@ modify_block(void)
r=t->r; r=t->r;
if (production(r)) { if (production(r)) {
switch (c) { switch (c) {
case 'e':
rsetpeasants(r, 0);
rsetmoney(r, 0);
rsethorses(r, 0);
rsettrees(r,2,0);
rsettrees(r,1,0);
rsettrees(r,0,0);
for (res=r->resources;res;res=res->next) {
const item_type * itype = resource2item(res->type->rtype);
if(itype == olditemtype[I_IRON]) {
res->amount = -1;
res->level = -1;
} else if(itype == olditemtype[I_LAEN]) {
res->amount = -1;
res->level = -1;
} else if(itype == olditemtype[I_STONE]) {
res->amount = -1;
res->level = -1;
}
}
freset(r, RF_MALLORN);
break;
case 'n': case 'n':
rsetname(r, name); rsetname(r, name);
break; break;