forked from github/server
Allow clearing the faction banner.
https://bugs.eressea.de/view.php?id=2774
This commit is contained in:
parent
860d5c75d7
commit
75a50345ff
|
@ -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) {
|
||||
|
|
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue