it's enough to let fix_astralplane do the thick fog, no need to have it in

create_teleport_plane (and it didn't work, either)
This commit is contained in:
Enno Rehling 2008-05-20 19:58:23 +00:00
parent 67c43c6ed2
commit ede420cd3b
2 changed files with 26 additions and 24 deletions

View File

@ -182,35 +182,21 @@ create_teleport_plane(void)
plane * aplane = get_astralplane();
const terrain_type * fog = get_terrain("fog");
const terrain_type * thickfog = get_terrain("thickfog");
if (fog==0 || thickfog==0) {
log_warning(("cannot find terrain-types for astral space.\n"));
return;
}
/* Regionsbereich aufbauen. */
/* wichtig: das muß auch für neue regionen gemacht werden.
* Evtl. bringt man es besser in new_region() unter, und
* übergibt an new_region die plane mit, in der die
* Region gemacht wird.
*/
for (r=regions;r;r=r->next) {
if (r->planep == NULL) {
region *ra = tpregion(r);
for (r=regions;r;r=r->next) if (r->planep == NULL) {
region *ra = tpregion(r);
if (ra==NULL) {
short x = TE_CENTER_X+real2tp(r->x);
short y = TE_CENTER_Y+real2tp(r->y);
plane * pl = findplane(x, y);
if (pl==aplane) {
ra = new_region(x, y, 0);
if (ra==NULL) {
short x = TE_CENTER_X+real2tp(r->x);
short y = TE_CENTER_Y+real2tp(r->y);
plane * pl = findplane(x, y);
if (fval(r->terrain, FORBIDDEN_REGION)) {
terraform_region(ra, thickfog);
} else {
if (pl==aplane) {
ra = new_region(x, y, 0);
terraform_region(ra, fog);
ra->planep = aplane;
}
ra->planep = aplane;
}
}
}

View File

@ -602,6 +602,22 @@ fix_astralplane(void)
rs_p = &rs->next;
}
for (rs_p = &regions;*rs_p;) {
region * rs = *rs_p;
if (fval(rs->terrain, FORBIDDEN_REGION)) {
while (rs->units) {
unit * u = rs->units;
if (is_monsters(u->faction)) {
i_freeall(&u->items);
remove_unit(&rs->units, u);
} else {
log_error(("unit %s is stuck in %s\n", unitname(u), regionname(rs, NULL)));
break;
}
}
}
rs_p = &rs->next;
}
log_printf("fixed %d fog/firewall regions.\n", fixes);
return 0;
}