diff options
author | IronClawTrem <louie.nutman@gmail.com> | 2020-03-07 20:29:10 +0000 |
---|---|---|
committer | IronClawTrem <louie.nutman@gmail.com> | 2020-03-07 20:29:10 +0000 |
commit | a359e7b9d929f3f18c24aacd78d5882f923a0680 (patch) | |
tree | 089623ce1f09c42081fdb472382606484a7f2f45 /src | |
parent | e948d6a2310979402b6fbce344e5ae9746c1c5ff (diff) |
fix g_admin.c code for admin level checking
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_admin.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 9e93377..d6b3f81 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -615,18 +615,13 @@ static qboolean admin_higher_guid( char *admin_guid, char *victim_guid ) { int i; int alevel = 0; - int alevel2 = 0; + qboolean perm = qfalse; for( i = 0; i < MAX_ADMIN_ADMINS && g_admin_admins[ i ]; i++ ) { if( !Q_stricmp( admin_guid, g_admin_admins[ i ]->guid ) ) { alevel = g_admin_admins[ i ]->level; - - // Novelty Levels should be equivelant to level 1 - if( alevel > 9 ) - alevel = 1; - break; } } @@ -634,17 +629,9 @@ static qboolean admin_higher_guid( char *admin_guid, char *victim_guid ) { if( !Q_stricmp( victim_guid, g_admin_admins[ i ]->guid ) ) { - alevel2 = g_admin_admins[ i ]->level; - - // Novelty Levels should be equivelant to level 1 - if( alevel2 > 9 ) - alevel2 = 1; - - if( alevel < alevel2 ) - return qfalse; - - if( strstr( g_admin_admins[ i ]->flags, va( "%s", ADMF_IMMUTABLE ) ) ) + if( alevel < g_admin_admins[ i ]->level ) return qfalse; + return ( !admin_permission( g_admin_admins[ i ]->flags, ADMF_IMMUTABLE, &perm ) || !perm ); } } return qtrue; |