fix: do not call regionname() twice.

This commit is contained in:
Enno Rehling 2008-08-18 16:39:08 +00:00
parent 9e529a50ae
commit 1ebe955bbe
4 changed files with 5 additions and 13 deletions

View file

@ -437,11 +437,6 @@ set_new_dragon_target(unit * u, region * r, int range)
} else {
a->data.v = max_region;
}
#if 0
sprintf(buf, "Kommt aus: %s, Will nach: %s",
regionname(r, u->faction), regionname(max_region, u->faction));
usetprivate(u, buf);
#endif
return a;
}
return NULL;

View file

@ -2591,10 +2591,6 @@ sp_summondragon(castorder *co)
} else {
a->data.v = co->rt;
}
#if 0
sprintf(buf, "Kommt aus: %s, Will nach: %s", regionname(r2, u->faction), regionname(co->rt, u->faction));
usetprivate(u, buf);
#endif
}
}
}
@ -4650,8 +4646,6 @@ sp_dragonsong(castorder *co)
} else {
a->data.v = r;
}
sprintf(buf, "Kommt aus: %s, Will nach: %s", regionname(r2, u->faction), regionname(r, u->faction));
usetprivate(u, buf);
}
}
}

View file

@ -249,7 +249,7 @@ extern char * strdup(const char *s);
#if defined (__GNUC__)
# define unused(a) /* unused: a */
#elif defined (ghs) || || defined (__hpux) || defined (__sgi) || defined (__DECCXX) || defined (__KCC) || defined (__rational__) || defined (__USLC__) || defined (ACE_RM544)
#elif defined (ghs) || defined (__hpux) || defined (__sgi) || defined (__DECCXX) || defined (__KCC) || defined (__rational__) || defined (__USLC__) || defined (ACE_RM544)
# define unused(a) do {/* null */} while (&a == 0)
#else /* ghs || __GNUC__ || ..... */
# define unused(a) (a)

View file

@ -532,6 +532,7 @@ fix_astralplane(void)
region * ra = r_standard_to_astral(rs);
if (ra && ra->terrain != newterrain(T_ASTRALB)) {
unit * u;
char name[128];
++fixes;
for (u=ra->units;u;u=u->next) {
if (!is_monsters(u->faction)) break;
@ -543,7 +544,9 @@ fix_astralplane(void)
while (ra->units) {
remove_unit(&ra->units, ra->units);
}
log_printf("protecting firewall in %s by blocking astral space in %s.\n", regionname(rs, NULL), regionname(ra, NULL));
/* regionname uses an internal buffer, so we can't clal it twice (ugh) */
write_regionname(rs, NULL, name, sizeof(name));
log_printf("protecting %s by blocking astral space in %s.\n", name, regionname(ra, NULL));
terraform_region(ra, newterrain(T_ASTRALB));
}
}