summaryrefslogtreecommitdiff
path: root/src/game/g_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/game/g_main.c')
-rw-r--r--src/game/g_main.c21
1 files changed, 8 insertions, 13 deletions
diff --git a/src/game/g_main.c b/src/game/g_main.c
index 902f9a0c..da521eb3 100644
--- a/src/game/g_main.c
+++ b/src/game/g_main.c
@@ -1661,11 +1661,11 @@ Print to all active server admins, and to the logfile, and to the server console
Prepend *prefix, or '[SERVER]' if no *prefix is given
=================
*/
-void QDECL G_AdminMessage( const char *prefix, const char *fmt, ... )
+void QDECL G_AdminMessage( gentity_t *ent, const char *fmt, ... )
{
va_list argptr;
char string[ 1024 ];
- char outstring[ 1024 ];
+ char outstring[ 1024 ] = S_COLOR_MAGENTA;
int i;
// Format the text
@@ -1673,26 +1673,21 @@ void QDECL G_AdminMessage( const char *prefix, const char *fmt, ... )
Q_vsnprintf( string, sizeof( string ), fmt, argptr );
va_end( argptr );
- // If there is no prefix, assume that this function was called directly
- // and we should add one
- if( !prefix || !prefix[ 0 ] )
- {
- prefix = "[SERVER]:";
- }
-
// Create the final string
- Com_sprintf( outstring, sizeof( outstring ), "%s " S_COLOR_MAGENTA "%s",
- prefix, string );
+ Q_strcat( outstring, sizeof( outstring ), string );
+ Com_sprintf( string, sizeof( string ), "chat \"%s\"", outstring );
// Send to all appropriate clients
for( i = 0; i < level.maxclients; i++ )
{
if( G_admin_permission( &g_entities[ i ], ADMF_ADMINCHAT ) )
- trap_SendServerCommand( i, va( "chat \"%s\"", outstring ) );
+ trap_SendServerCommand( i, string );
}
// Send to the logfile and server console
- G_LogPrintf("adminmsg: %s\n", outstring );
+ G_LogPrintf( "AdminMsg: %d \"%s" S_COLOR_WHITE "\": %s\n",
+ ent ? ent - g_entities : -1, ent ? ent->client->pers.netname : "console",
+ outstring );
}