From: Ari Johnson Date: Sat, 3 Mar 2007 00:38:25 +0000 (+0000) Subject: Better error messages for invalid function restrictions X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=ce304b0513fa51611a20ca1edf8996bdfb9e3f1b;p=cobramush.git Better error messages for invalid function restrictions --- 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.")); }