From 81994ecf58c4bc1fe2bc65a17b9e0a8b9e77959e Mon Sep 17 00:00:00 2001 From: Steve Dudenhoeffer Date: Fri, 30 Mar 2007 02:04:30 +0000 Subject: [PATCH] Fix for access() with ADMIN_ALL Very minor optimization for is_user_admin (amb81) --- plugins/include/amxmisc.inc | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/plugins/include/amxmisc.inc b/plugins/include/amxmisc.inc index 7eaced69..bbcaf340 100755 --- a/plugins/include/amxmisc.inc +++ b/plugins/include/amxmisc.inc @@ -29,7 +29,8 @@ stock is_user_admin(id) { - return ( get_user_flags(id)>0 && !(get_user_flags(id)&ADMIN_USER) ); + new __flags=get_user_flags(id); + return (__flags>0 && !(__flags&ADMIN_USER)); } stock cmd_access(id,level,cid,num) @@ -81,10 +82,14 @@ stock cmd_access(id,level,cid,num) stock access(id,level) { - if ( level==ADMIN_ADMIN ) + if (level==ADMIN_ADMIN) { return is_user_admin(id); } + else if (level==ADMIN_ALL) + { + return 1; + } return (get_user_flags(id) & level); }