"Ozean wird im CR zum Regionstyp Mahlstrom, verliert im CR aber seinen Namen"

Maelstrom wird jetzt programmatisch in terrain_name gemacht (auch wenn es besser in terrain::name() sein sollte).
This commit is contained in:
Enno Rehling 2007-03-04 22:27:32 +00:00
parent 6dd3e9b1d4
commit 68e2ec932f
4 changed files with 27 additions and 34 deletions

View File

@ -1270,11 +1270,7 @@ report_computer(const char * filename, report_context * ctx)
else fprintf(F, "REGION %d %d %d\n", region_x(r, f), region_y(r, f), r->planep->id); else fprintf(F, "REGION %d %d %d\n", region_x(r, f), region_y(r, f), r->planep->id);
} }
if (r->land && strlen(rname(r, f->locale))) fprintf(F, "\"%s\";Name\n", rname(r, f->locale)); if (r->land && strlen(rname(r, f->locale))) fprintf(F, "\"%s\";Name\n", rname(r, f->locale));
if (is_cursed(r->attribs,C_MAELSTROM, 0)) tname = terrain_name(r);
tname = "maelstrom";
else {
tname = terrain_name(r);
}
fprintf(F, "\"%s\";Terrain\n", add_translation(tname, locale_string(f->locale, tname))); fprintf(F, "\"%s\";Terrain\n", add_translation(tname, locale_string(f->locale, tname)));
if (sr->mode!=see_unit) fprintf(F, "\"%s\";visibility\n", visibility[sr->mode]); if (sr->mode!=see_unit) fprintf(F, "\"%s\";visibility\n", visibility[sr->mode]);

View File

@ -741,13 +741,7 @@ trailinto(const region * r, const struct locale * lang)
char ref[32]; char ref[32];
const char * s; const char * s;
if (r) { if (r) {
const char * tname; const char * tname = terrain_name(r);
if (is_cursed(r->attribs, C_MAELSTROM, 0)) {
/* das kostet. evtl. wäre ein FL_CURSED gut? */
tname = "maelstrom";
} else {
tname = terrain_name(r);
}
strcat(strcpy(ref, tname), "_trail"); strcat(strcpy(ref, tname), "_trail");
s = locale_string(lang, ref); s = locale_string(lang, ref);
if (s && *s) { if (s && *s) {
@ -836,11 +830,8 @@ describe(FILE * F, const region * r, int partial, faction * f)
/* Terrain */ /* Terrain */
bufp += strxcpy(bufp, ", "); bufp += strxcpy(bufp, ", ");
if (is_cursed(r->attribs,C_MAELSTROM, 0)) {
tname = "maelstrom"; tname = terrain_name(r);
} else {
tname = terrain_name(r);
}
bufp += strxcpy(bufp, LOC(f->locale, tname)); bufp += strxcpy(bufp, LOC(f->locale, tname));
/* Bäume */ /* Bäume */

View File

@ -2572,7 +2572,7 @@ aftermath(battle * b)
* stehen in fig->run.items. Dann werden die Fliehenden auf * stehen in fig->run.items. Dann werden die Fliehenden auf
* die leere (tote) alte Einheit gemapt */ * die leere (tote) alte Einheit gemapt */
#ifdef SIMPLE_ESCAPE #ifdef SIMPLE_ESCAPE
if (!fval(df, FIG_NOLOOT)){ if (!fval(df, FIG_NOLOOT)) {
loot_items(df); loot_items(df);
} }
#else #else

View File

@ -1,7 +1,7 @@
/* vi: set ts=2: /* vi: set ts=2:
* *
* *
* Eressea PB(E)M host Copyright (C) 1998-2003 * Eressea PB(E)M host Copyright (C) 1998-2003
* Christian Schlittchen (corwin@amber.kn-bremen.de) * Christian Schlittchen (corwin@amber.kn-bremen.de)
* Katja Zedel (katze@felidae.kn-bremen.de) * Katja Zedel (katze@felidae.kn-bremen.de)
* Henning Peters (faroul@beyond.kn-bremen.de) * Henning Peters (faroul@beyond.kn-bremen.de)
@ -37,20 +37,20 @@
#define MAXTERRAINS 20 #define MAXTERRAINS 20
const char * terraindata[] = { const char * terraindata[] = {
"ocean", "ocean",
"plain", "plain",
"swamp", "swamp",
"desert", "desert",
"highland", "highland",
"mountain", "mountain",
"glacier", "glacier",
"firewall", "firewall",
"hell", /* dungeon module */ "hell", /* dungeon module */
"plain", /* former grassland */ "plain", /* former grassland */
"fog", "fog",
"thickfog", "thickfog",
"volcano", "volcano",
"activevolcano", "activevolcano",
"iceberg_sleep", "iceberg_sleep",
"iceberg", "iceberg",
@ -123,7 +123,13 @@ oldterrain(const struct terrain_type * terrain)
const char * const char *
terrain_name(const struct region * r) terrain_name(const struct region * r)
{ {
if (r->terrain->name!=NULL) return r->terrain->name(r); if (r->terrain->name!=NULL) {
return r->terrain->name(r);
} else if (fval(r->terrain, SEA_REGION)) {
if (is_cursed(r->attribs, C_MAELSTROM, 0)) {
return "maelstrom";
}
}
return r->terrain->_name; return r->terrain->_name;
} }