summaryrefslogtreecommitdiff
path: root/src/game
diff options
context:
space:
mode:
authorM. Kristall <mkpdev@gmail.com>2011-02-21 23:11:08 +0000
committerTim Angus <tim@ngus.net>2013-01-03 00:18:02 +0000
commit93d9c093f4ff092675e5557bc56aedd72187ae27 (patch)
treec0b6c4012538967d7735fcb16498ef3adfd4ed3b /src/game
parentb0dbbfd725eddb6e3a585144f8a772e4ae61dc31 (diff)
* Show who received a private message and how to respond again
Diffstat (limited to 'src/game')
-rw-r--r--src/game/g_cmds.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/game/g_cmds.c b/src/game/g_cmds.c
index 1396b583..d31e3821 100644
--- a/src/game/g_cmds.c
+++ b/src/game/g_cmds.c
@@ -3301,13 +3301,13 @@ void Cmd_PrivateMessage_f( gentity_t *ent )
int pids[ MAX_CLIENTS ];
char name[ MAX_NAME_LENGTH ];
char cmd[ 12 ];
- char str[ MAX_STRING_CHARS ];
char text[ MAX_STRING_CHARS ];
char *msg;
char color;
int i, pcount;
int count = 0;
qboolean teamonly = qfalse;
+ char recipients[ MAX_STRING_CHARS ] = "";
if( !g_privateMessages.integer && ent )
{
@@ -3333,23 +3333,29 @@ void Cmd_PrivateMessage_f( gentity_t *ent )
// send the message
for( i = 0; i < pcount; i++ )
+ {
if( G_SayTo( ent, &g_entities[ pids[ i ] ],
teamonly ? SAY_TPRIVMSG : SAY_PRIVMSG, text ) )
+ {
count++;
+ Q_strcat( recipients, sizeof( recipients ), va( "%s" S_COLOR_WHITE ", ",
+ level.clients[ pids[ i ] ].pers.netname ) );
+ }
+ }
// report the results
color = teamonly ? COLOR_CYAN : COLOR_YELLOW;
- Com_sprintf( str, sizeof( str ), "^%csent to %i player%s", color, count,
- ( count == 1 ) ? "" : "s" );
-
if( !count )
ADMP( va( "^3No player matching ^7\'%s^7\' ^3to send message to.\n",
name ) );
else
{
ADMP( va( "^%cPrivate message: ^7%s\n", color, text ) );
- ADMP( va( "%s\n", str ) );
+ // remove trailing ", "
+ recipients[ strlen( recipients ) - 2 ] = '\0';
+ ADMP( va( "^%csent to %i player%s: " S_COLOR_WHITE "%s\n", color, count,
+ count == 1 ? "" : "s", recipients ) );
G_LogPrintf( "%s: %d \"%s" S_COLOR_WHITE "\" \"%s\": ^%c%s\n",
( teamonly ) ? "TPrivMsg" : "PrivMsg",