diff options
author | Paweł Redman <pawel.redman@gmail.com> | 2018-06-22 10:15:27 +0200 |
---|---|---|
committer | Paweł Redman <pawel.redman@gmail.com> | 2018-06-22 10:15:27 +0200 |
commit | da4b56aa95ce0f52d5fec3b95fa7c4d21f7077f2 (patch) | |
tree | 4089df42b30128e16b86e12efe89aa107c16bcd3 /src | |
parent | 51b8c86e856a80a01d4568d057af31e6d5fd49b2 (diff) |
Fix console erroneously being treated as a lower level admin.
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_admin.c | 7 | ||||
-rw-r--r-- | src/game/g_admin.h | 3 |
2 files changed, 8 insertions, 2 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 817c4ba..7aa972f 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -1281,7 +1281,7 @@ int G_admin_level( gentity_t *ent ) if( !ent ) { - return MAX_ADMIN_LEVELS; + return MAX_ADMIN_LEVEL + 1; } for( i = 0; i < MAX_ADMIN_ADMINS && g_admin_admins[ i ]; i++ ) @@ -2126,6 +2126,11 @@ qboolean G_admin_readconfig( gentity_t *ent, int skiparg ) if( !Q_stricmp( t, "level" ) ) { admin_readconfig_int( &cnf, &l->level ); + if( l->level > MAX_ADMIN_LEVEL ) + { + ADMP( va( "^3!readconfig: ^7admin level %d too high\n", l->level) ); + l->level = MAX_ADMIN_LEVEL; + } } else if( !Q_stricmp( t, "name" ) ) { diff --git a/src/game/g_admin.h b/src/game/g_admin.h index 5e25266..051cd06 100644 --- a/src/game/g_admin.h +++ b/src/game/g_admin.h @@ -31,7 +31,8 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA #define ADMBP_begin() G_admin_buffer_begin() #define ADMBP_end() G_admin_buffer_end(ent) -#define MAX_ADMIN_LEVELS 32 +#define MAX_ADMIN_LEVELS 32 +#define MAX_ADMIN_LEVEL 1000000 #define MAX_ADMIN_ADMINS 2048 #define MAX_ADMIN_BANS 1024 #define MAX_ADMIN_NAMELOGS 128 |