Allow clearing the faction banner.

https://bugs.eressea.de/view.php?id=2774
This commit is contained in:
Enno Rehling 2021-09-12 19:57:19 +02:00
parent 860d5c75d7
commit 75a50345ff
2 changed files with 8 additions and 8 deletions

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

@ -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;
}