Fix for access() with ADMIN_ALL

Very minor optimization for is_user_admin

(amb81)
This commit is contained in:
Steve Dudenhoeffer 2007-03-30 02:04:30 +00:00
parent 4682cec1cb
commit 81994ecf58

View File

@ -29,7 +29,8 @@
stock is_user_admin(id) 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) stock cmd_access(id,level,cid,num)
@ -85,6 +86,10 @@ stock access(id,level)
{ {
return is_user_admin(id); return is_user_admin(id);
} }
else if (level==ADMIN_ALL)
{
return 1;
}
return (get_user_flags(id) & level); return (get_user_flags(id) & level);
} }