From fef2852c5e41824f4a0bf58477a641780f52a2ff Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 6 Aug 2016 14:36:54 +0200 Subject: [PATCH] Reparatur Irrlichter https://bugs.eressea.de/view.php?id=2227 --- src/creport.c | 3 ++- src/kernel/connection.c | 4 ++++ src/kernel/connection.h | 3 +++ src/report.c | 2 +- 4 files changed, 10 insertions(+), 2 deletions(-) diff --git a/src/creport.c b/src/creport.c index ab5813e8a..6ba9f5e39 100644 --- a/src/creport.c +++ b/src/creport.c @@ -1160,7 +1160,8 @@ int seemode, FILE * F) } } if (cs) { - const char *bname = mkname("border", b->type->name(b, r, f, GF_PURE)); + const char *bname = border_name(b, r, f, GF_PURE); + bname = mkname("border", bname); fprintf(F, "GRENZE %d\n", ++g); fprintf(F, "\"%s\";typ\n", LOC(default_locale, bname)); fprintf(F, "%d;richtung\n", d); diff --git a/src/kernel/connection.c b/src/kernel/connection.c index d9f1871d0..f1e5c4b6d 100644 --- a/src/kernel/connection.c +++ b/src/kernel/connection.c @@ -677,3 +677,7 @@ int read_borders(gamedata *data) } return 0; } + +const char * border_name(const connection *co, const struct region * r, const struct faction * f, int flags) { + return (co->type->name) ? co->type->name(co, r, f, flags) : co->type->__name; +} diff --git a/src/kernel/connection.h b/src/kernel/connection.h index 2c0800849..7eef0f52a 100644 --- a/src/kernel/connection.h +++ b/src/kernel/connection.h @@ -148,6 +148,9 @@ extern "C" { /* game-specific callbacks */ void(*border_convert_cb) (struct connection * con, struct attrib * attr); + const char * border_name(const struct connection *co, + const struct region * r, const struct faction * f, int flags); + #ifdef __cplusplus } #endif diff --git a/src/report.c b/src/report.c index 229b16332..84b1291b2 100644 --- a/src/report.c +++ b/src/report.c @@ -915,7 +915,7 @@ static void describe(stream *out, const seen_region * sr, faction * f) for (b = get_borders(r, r2); b;) { struct edge *e = edges; bool transparent = b->type->transparent(b, f); - const char *name = b->type->name(b, r, f, GF_DETAILED | GF_ARTICLE); + const char *name = border_name(b, r, f, GF_DETAILED | GF_ARTICLE); if (!transparent) see[d] = false;