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) 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) { 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); init_order(ord, NULL);
s = getstrtoken(); s = getstrtoken();
if (!s || !s[0]) { faction_setbanner(u->faction, s);
cmistake(u, ord, 125, MSG_EVENT); ADDMSG(&u->faction->msgs, msg_message("changebanner", "value", s));
}
else {
faction_setbanner(u->faction, s);
ADDMSG(&u->faction->msgs, msg_message("changebanner", "value", s));
}
return 0; return 0;
} }