diff options
author | M. Kristall <mkpdev@gmail.com> | 2007-07-09 15:20:42 +0000 |
---|---|---|
committer | M. Kristall <mkpdev@gmail.com> | 2007-07-09 15:20:42 +0000 |
commit | 655d4c12eea45edf2041300eccace352a503b690 (patch) | |
tree | 911eb6f2231fa6e9aa0c9d78bdb2bce7c9571618 /src | |
parent | fd37b424a64ca211b50132cb1f5e61135d1ca09b (diff) |
* (bug 3251) make return consistent for admin check (benmachine)
* show message when trying to get help for a command you cannot use
Diffstat (limited to 'src')
-rw-r--r-- | src/game/g_admin.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/game/g_admin.c b/src/game/g_admin.c index 8ffa2702..0b3da10b 100644 --- a/src/game/g_admin.c +++ b/src/game/g_admin.c @@ -975,31 +975,31 @@ qboolean G_admin_cmd_check( gentity_t *ent, qboolean say ) { trap_SendConsoleCommand( EXEC_APPEND, g_admin_commands[ i ]->exec ); admin_log( ent, cmd, skip ); - return qtrue; } else { ADMP( va( "^3!%s: ^7permission denied\n", g_admin_commands[ i ]->command ) ); admin_log( ent, "attempted", skip - 1 ); - return qfalse; } + return qtrue; } for( i = 0; i < adminNumCmds; i++ ) { if( Q_stricmp( cmd, g_admin_cmds[ i ].keyword ) ) continue; + if( G_admin_permission( ent, g_admin_cmds[ i ].flag[ 0 ] ) ) { g_admin_cmds[ i ].handler( ent, skip ); admin_log( ent, cmd, skip ); - return qtrue; } else { ADMP( va( "^3!%s: ^7permission denied\n", g_admin_cmds[ i ].keyword ) ); admin_log( ent, "attempted", skip - 1 ); } + return qtrue; } return qfalse; } @@ -2536,6 +2536,7 @@ qboolean G_admin_help( gentity_t *ent, int skiparg ) { ADMBP( va( "^3!help: ^7you have no permission to use '%s'\n", g_admin_cmds[ i ].keyword ) ); + ADMBP_end(); return qfalse; } ADMBP( va( "^3!help: ^7help for '!%s':\n", |