From 112126b07b4d5900fad8a8d3e504796445ddef4e Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Wed, 25 Mar 2020 19:20:51 +0100 Subject: [PATCH 1/2] =?UTF-8?q?Bug=202653:=20Fehlermeldungen=20bei=20?= =?UTF-8?q?=C3=9Cbergabe=20von=20Schiffen.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- res/core/messages.xml | 56 +++++++++++++++++++++++++++++++++ res/translations/messages.de.po | 3 ++ res/translations/messages.en.po | 3 ++ src/give.c | 2 +- src/report.c | 6 ++-- src/util/message.c | 2 +- 6 files changed, 67 insertions(+), 5 deletions(-) diff --git a/res/core/messages.xml b/res/core/messages.xml index d40efb9ac..62662848e 100644 --- a/res/core/messages.xml +++ b/res/core/messages.xml @@ -3740,6 +3740,62 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/res/translations/messages.de.po b/res/translations/messages.de.po index 5d2717e51..0222e6ab9 100644 --- a/res/translations/messages.de.po +++ b/res/translations/messages.de.po @@ -2783,6 +2783,9 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - Das Schiff ist msgid "error327" msgstr "\"$unit($unit) in $region($region): '$order($command)' - So viele Schiffe kann die Einheit nicht übergeben.\"" +msgid "error328" +msgstr "\"$unit($unit) in $region($region): '$order($command)' - Dafür müssen die Schiffe an der selben Küste liegen.\"" + msgid "error326" msgstr "\"$unit($unit) in $region($region): '$order($command)' - Diese Schiffe können keinen Konvoi bilden.\"" diff --git a/res/translations/messages.en.po b/res/translations/messages.en.po index 659adee9f..7309f91ca 100644 --- a/res/translations/messages.en.po +++ b/res/translations/messages.en.po @@ -2723,6 +2723,9 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - The unit did no msgid "error182" msgstr "\"$unit($unit) in $region($region): '$order($command)' - The ship cannot leave in this direction.\"" +msgid "error321" +msgstr "\"$unit($unit) in $region($region): '$order($command)' - The ships need to be on the same coast for this.\"" + msgid "analyse_ship_nospell" msgstr "\"It appears to $unit($mage) that $ship($ship) is not charmed.\"" diff --git a/src/give.c b/src/give.c index ac792da9a..ff1a3ac03 100644 --- a/src/give.c +++ b/src/give.c @@ -371,7 +371,7 @@ message * give_ship(unit *u1, unit *u2, int n, order *ord) u2->ship->coast = u1->ship->coast; } else { - return msg_error(u1, ord, 182); + return msg_error(u1, ord, 328); } } } diff --git a/src/report.c b/src/report.c index 7fdf8e690..63d72bd49 100644 --- a/src/report.c +++ b/src/report.c @@ -1718,23 +1718,23 @@ nr_ship(struct stream *out, const region *r, const ship * sh, const faction * f, char buffer[1024]; char ch; sbstring sbs; + const char *stname; sbs_init(&sbs, buffer, sizeof(buffer)); newline(out); + stname = locale_plural(f->locale, sh->type->_name, sh->number, true); if (captain && captain->faction == f) { int n = 0, p = 0; - const char *stname; getshipweight(sh, &n, &p); n = (n + 99) / 100; /* 1 Silber = 1 GE */ - stname = locale_plural(f->locale, sh->type->_name, sh->number, true); sbs_printf(&sbs, "%s, %d %s, (%d/%d)", shipname(sh), sh->number, stname, n, ship_capacity(sh) / 100); } else { - sbs_printf(&sbs, "%s, %s", shipname(sh), LOC(f->locale, sh->type->_name)); + sbs_printf(&sbs, "%s, %d %s", sh->number, shipname(sh), stname); } if (!ship_finished(sh)) { diff --git a/src/util/message.c b/src/util/message.c index 38254958b..a1618f832 100644 --- a/src/util/message.c +++ b/src/util/message.c @@ -277,7 +277,7 @@ const message_type *mt_find(const char *name) return data; } } - return 0; + return NULL; } void msg_free(message * msg) From a60859ad089d23500643de701e5f0927f8ca5dd9 Mon Sep 17 00:00:00 2001 From: Enno Rehling Date: Sat, 28 Mar 2020 09:05:52 +0100 Subject: [PATCH 2/2] ship report crash, fix error number --- res/translations/messages.en.po | 6 +++--- src/report.c | 2 +- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/res/translations/messages.en.po b/res/translations/messages.en.po index 7309f91ca..67d1d2de0 100644 --- a/res/translations/messages.en.po +++ b/res/translations/messages.en.po @@ -2723,9 +2723,6 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - The unit did no msgid "error182" msgstr "\"$unit($unit) in $region($region): '$order($command)' - The ship cannot leave in this direction.\"" -msgid "error321" -msgstr "\"$unit($unit) in $region($region): '$order($command)' - The ships need to be on the same coast for this.\"" - msgid "analyse_ship_nospell" msgstr "\"It appears to $unit($mage) that $ship($ship) is not charmed.\"" @@ -2789,6 +2786,9 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - The unit is alr msgid "error323" msgstr "\"$unit($unit) in $region($region): '$order($command)' - The ship is under a spell.\"" +msgid "error328" +msgstr "\"$unit($unit) in $region($region): '$order($command)' - The ships need to be on the same coast for this.\"" + msgid "dissolve_units_2" msgstr "\"$unit($unit) in $region($region): $int($number) $race($race,$number) turned into $if($eq($number,1),\"a tree\", \"trees\").\"" diff --git a/src/report.c b/src/report.c index 63d72bd49..1560f42e2 100644 --- a/src/report.c +++ b/src/report.c @@ -1734,7 +1734,7 @@ nr_ship(struct stream *out, const region *r, const ship * sh, const faction * f, stname, n, ship_capacity(sh) / 100); } else { - sbs_printf(&sbs, "%s, %d %s", sh->number, shipname(sh), stname); + sbs_printf(&sbs, "%s, %d %s", shipname(sh), sh->number, stname); } if (!ship_finished(sh)) {