From: Ari Johnson Date: Mon, 29 Sep 2008 15:40:13 +0000 (+0000) Subject: Allow players to change to forbidden names they already use X-Git-Tag: 0.73p1~27 X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=32e9935f692ee8c96e0e12d4b63c6aa04c98bd21;p=cobramush.git Allow players to change to forbidden names they already use (cherry picked from commit 80ba61c1f52dafd75f97828e4c7e49b354941f94) --- diff --git a/src/predicat.c b/src/predicat.c index 87e4301..3141b91 100644 --- a/src/predicat.c +++ b/src/predicat.c @@ -803,9 +803,7 @@ ok_player_name(const char *name, dbref player, dbref thing) const unsigned char *scan, *good; dbref lookup; - if (!ok_name(name) - || (forbidden_name(name) && !(GoodObject(player) && Director(player))) - || strlen(name) >= (size_t) PLAYER_NAME_LIMIT) + if (!ok_name(name) || strlen(name) >= (size_t) PLAYER_NAME_LIMIT) return 0; good = (unsigned char *) (PLAYER_NAME_SPACES ? " `$_-.,'" : "`$_-.,'"); @@ -819,6 +817,13 @@ ok_player_name(const char *name, dbref player, dbref thing) } lookup = lookup_player(name); + + /* A player may only change to a forbidden name if they're already + using that name. */ + if (forbidden_name(name) && !((lookup == thing) || + (GoodObject(player) && Director(player)))) + return 0; + return ((lookup == NOTHING) || (lookup == thing)); }