From 68e2ec932f0f73e0284aefa2b1e23dbec80e1079 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sun, 4 Mar 2007 22:27:32 +0000 Subject: [PATCH] http://eressea.upb.de/mantis/view.php?id=1149 "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). --- src/common/gamecode/creport.c | 6 +----- src/common/gamecode/report.c | 15 +++----------- src/common/kernel/battle.c | 2 +- src/common/kernel/terrain.c | 38 ++++++++++++++++++++--------------- 4 files changed, 27 insertions(+), 34 deletions(-) diff --git a/src/common/gamecode/creport.c b/src/common/gamecode/creport.c index 44fc780f3..9a56f7e53 100644 --- a/src/common/gamecode/creport.c +++ b/src/common/gamecode/creport.c @@ -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); } 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 = "maelstrom"; - else { - tname = terrain_name(r); - } + tname = terrain_name(r); 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]); diff --git a/src/common/gamecode/report.c b/src/common/gamecode/report.c index 6bc9ed8cf..81fa2e87f 100644 --- a/src/common/gamecode/report.c +++ b/src/common/gamecode/report.c @@ -741,13 +741,7 @@ trailinto(const region * r, const struct locale * lang) char ref[32]; const char * s; if (r) { - const char * tname; - if (is_cursed(r->attribs, C_MAELSTROM, 0)) { - /* das kostet. evtl. wäre ein FL_CURSED gut? */ - tname = "maelstrom"; - } else { - tname = terrain_name(r); - } + const char * tname = terrain_name(r); strcat(strcpy(ref, tname), "_trail"); s = locale_string(lang, ref); if (s && *s) { @@ -836,11 +830,8 @@ describe(FILE * F, const region * r, int partial, faction * f) /* Terrain */ bufp += strxcpy(bufp, ", "); - if (is_cursed(r->attribs,C_MAELSTROM, 0)) { - tname = "maelstrom"; - } else { - tname = terrain_name(r); - } + + tname = terrain_name(r); bufp += strxcpy(bufp, LOC(f->locale, tname)); /* Bäume */ diff --git a/src/common/kernel/battle.c b/src/common/kernel/battle.c index 73eaef0a5..1fd190e59 100644 --- a/src/common/kernel/battle.c +++ b/src/common/kernel/battle.c @@ -2572,7 +2572,7 @@ aftermath(battle * b) * stehen in fig->run.items. Dann werden die Fliehenden auf * die leere (tote) alte Einheit gemapt */ #ifdef SIMPLE_ESCAPE - if (!fval(df, FIG_NOLOOT)){ + if (!fval(df, FIG_NOLOOT)) { loot_items(df); } #else diff --git a/src/common/kernel/terrain.c b/src/common/kernel/terrain.c index 4884d7f3e..3dbe8c409 100644 --- a/src/common/kernel/terrain.c +++ b/src/common/kernel/terrain.c @@ -1,7 +1,7 @@ /* 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) * Katja Zedel (katze@felidae.kn-bremen.de) * Henning Peters (faroul@beyond.kn-bremen.de) @@ -37,23 +37,23 @@ #define MAXTERRAINS 20 const char * terraindata[] = { - "ocean", - "plain", - "swamp", - "desert", - "highland", - "mountain", - "glacier", - "firewall", - "hell", /* dungeon module */ + "ocean", + "plain", + "swamp", + "desert", + "highland", + "mountain", + "glacier", + "firewall", + "hell", /* dungeon module */ "plain", /* former grassland */ "fog", "thickfog", "volcano", - "activevolcano", + "activevolcano", "iceberg_sleep", "iceberg", - + "hall1", /* museum module */ "corridor1", /* museum module */ "plain", /* former magicstorm */ @@ -63,7 +63,7 @@ const char * terraindata[] = { static terrain_type * registered_terrains; -const terrain_type * +const terrain_type * terrains(void) { return registered_terrains; @@ -83,7 +83,7 @@ register_terrain(struct terrain_type * terrain) assert(terrain->next==NULL), terrain->next = registered_terrains; registered_terrains = terrain; - if (strcmp("plain", terrain->_name)==0) + if (strcmp("plain", terrain->_name)==0) terrain->name = &plain_name; } @@ -123,7 +123,13 @@ oldterrain(const struct terrain_type * terrain) const char * 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; }