From ce304b0513fa51611a20ca1edf8996bdfb9e3f1b Mon Sep 17 00:00:00 2001 From: Ari Johnson Date: Sat, 3 Mar 2007 00:38:25 +0000 Subject: [PATCH] Better error messages for invalid function restrictions --- src/function.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/function.c b/src/function.c index ce234c6..7096712 100644 --- a/src/function.c +++ b/src/function.c @@ -1089,8 +1089,15 @@ do_function_restrict(dbref player, const char *name, const char *restriction) notify(player, T("Do what with the function?")); return; } - if (restrict_function(name, restriction)) - notify(player, T("Restrictions modified.")); + fp = func_hash_lookup(name); + if (!fp) { + notify(player, T("No such function.")); + return; + } + flags = fp->flags; + fp->flags = apply_restrictions(flags, restriction); + if (fp->flags == flags) + notify(player, T("Restrictions unchanged.")); else notify(player, T("Restrictions modified.")); } -- 2.30.2