From 80ba61c1f52dafd75f97828e4c7e49b354941f94 Mon Sep 17 00:00:00 2001 From: Ari Johnson Date: Mon, 29 Sep 2008 15:40:13 +0000 Subject: [PATCH] Allow players to change to forbidden names they already use --- src/predicat.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) 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)); } -- 2.30.2