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,8 +538,13 @@ const char *faction_getbanner(const faction * f)
void faction_setbanner(faction * f, const char *banner) void faction_setbanner(faction * f, const char *banner)
{ {
if (banner && banner[0]) {
f->banner_id = dbstring_save(banner); f->banner_id = dbstring_save(banner);
} }
else {
f->banner_id = 0;
}
}
const char *faction_getpassword(const faction *f) { const char *faction_getpassword(const faction *f) {
if (f->password_id > 0) { if (f->password_id > 0) {

View File

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