summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_admin.c7
-rw-r--r--src/game/g_admin.h3
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