Compare commits

...

7 Commits

Author SHA1 Message Date
Marc 8d3b91de90 adding cmake-init command 2021-09-30 09:20:54 +02:00
Enno Rehling 9d5b501994 Merge branch 'master' into develop 2021-09-19 01:45:59 +02:00
Enno Rehling 209040e198 bugfix crash 9/19/2001
when seen from lighthouse, skip units in buildings.
2021-09-19 01:41:41 +02:00
Enno Rehling 6a26ed5897 banner: fix test that was enforcing the old behavior 2021-09-12 20:10:49 +02:00
Enno Rehling f40569033d banner: remove unused error message 2021-09-12 20:06:32 +02:00
Enno Rehling c3db8a4a05 version number increase 2021-09-12 20:05:31 +02:00
Enno Rehling 75a50345ff Allow clearing the faction banner.
https://bugs.eressea.de/view.php?id=2774
2021-09-12 20:05:30 +02:00
8 changed files with 12 additions and 25 deletions

View File

@ -23,6 +23,7 @@ Here's how you clone and build the source on Linux or macOS:
git clone --recursive git://github.com/eressea/server.git source
cd source
git submodule update --init
s/cmake-init
s/build
If you got this far and all went well, you have built the server, and

View File

@ -4535,13 +4535,6 @@
<arg name="command" type="order"/>
</type>
</message>
<message name="error125" section="errors">
<type>
<arg name="unit" type="unit"/>
<arg name="region" type="region"/>
<arg name="command" type="order"/>
</type>
</message>
<message name="error84" section="errors">
<type>
<arg name="unit" type="unit"/>

View File

@ -692,9 +692,6 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - Die Einheit kan
msgid "error85"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Es wurde keine Emailadresse angegeben.\""
msgid "error125"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - Es wurde kein Banner angegeben.\""
msgid "starvation"
msgstr "\"$unit($unit) verliert in $region($region) $int($dead) von $int($add($live,$dead)) Personen durch Unterernährung.\""

View File

@ -692,9 +692,6 @@ msgstr "\"$unit($unit) in $region($region): '$order($command)' - The unit cannot
msgid "error85"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - No email address was supplied.\""
msgid "error125"
msgstr "\"$unit($unit) in $region($region): '$order($command)' - No banner text was supplied.\""
msgid "starvation"
msgstr "\"$unit($unit) loses $int($dead) of $int($add($live,$dead)) people due to starvation in $region($region).\""

View File

@ -538,7 +538,12 @@ const char *faction_getbanner(const faction * f)
void faction_setbanner(faction * f, const char *banner)
{
f->banner_id = dbstring_save(banner);
if (banner && banner[0]) {
f->banner_id = dbstring_save(banner);
}
else {
f->banner_id = 0;
}
}
const char *faction_getpassword(const faction *f) {

View File

@ -8,7 +8,7 @@
#ifndef ERESSEA_VERSION
/* the version number, if it was not passed to make with -D */
#define ERESSEA_VERSION "3.29.0"
#define ERESSEA_VERSION "3.30.0"
#endif
const char *eressea_version(void) {

View File

@ -2162,13 +2162,8 @@ int banner_cmd(unit * u, struct order *ord)
init_order(ord, NULL);
s = getstrtoken();
if (!s || !s[0]) {
cmistake(u, ord, 125, MSG_EVENT);
}
else {
faction_setbanner(u->faction, s);
ADDMSG(&u->faction->msgs, msg_message("changebanner", "value", s));
}
faction_setbanner(u->faction, s);
ADDMSG(&u->faction->msgs, msg_message("changebanner", "value", s));
return 0;
}

View File

@ -1312,7 +1312,6 @@ static void test_banner_cmd(CuTest *tc) {
order *ord;
test_setup();
mt_create_error(125);
mt_create_va(mt_new("changebanner", NULL), "value:string", MT_NEW_END);
u = test_create_unit(f = test_create_faction(), test_create_region(0, 0, NULL));
@ -1325,8 +1324,8 @@ static void test_banner_cmd(CuTest *tc) {
ord = create_order(K_BANNER, f->locale, NULL);
banner_cmd(u, ord);
CuAssertStrEquals(tc, "Hodor!", faction_getbanner(f));
CuAssertPtrNotNull(tc, test_find_messagetype(u->faction->msgs, "error125"));
CuAssertStrEquals(tc, NULL, faction_getbanner(f));
CuAssertPtrNotNull(tc, test_find_messagetype(u->faction->msgs, "changebanner"));
free_order(ord);
test_clear_messages(f);