From 0455a2d77319d0ba7e15160e868538c03a060311 Mon Sep 17 00:00:00 2001 From: divverent Date: Wed, 17 Aug 2011 07:42:33 +0000 Subject: [PATCH] allow extra args for messagemode and messagemode2 to prefill a message prefix useful for quick team communication binds (e.g. putting "Get the flag," in the message, and using tab completion to fill in the name who should do it) git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@11282 d7cf8633-e32d-0410-b094-e92efae38249 ::stable-branch::merge=6d472eb4b897879d92a89416a5785a3fc78da3e7 --- console.c | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/console.c b/console.c index bb9c277d..48dcac3d 100644 --- a/console.c +++ b/console.c @@ -623,8 +623,11 @@ void Con_MessageMode_f (void) { key_dest = key_message; chat_mode = 0; // "say" - chat_bufferlen = 0; - chat_buffer[0] = 0; + if(Cmd_Argc() > 1) + { + dpsnprintf(chat_buffer, sizeof(chat_buffer), "%s ", Cmd_Args()); + chat_bufferlen = strlen(chat_buffer); + } } @@ -637,8 +640,11 @@ void Con_MessageMode2_f (void) { key_dest = key_message; chat_mode = 1; // "say_team" - chat_bufferlen = 0; - chat_buffer[0] = 0; + if(Cmd_Argc() > 1) + { + dpsnprintf(chat_buffer, sizeof(chat_buffer), "%s ", Cmd_Args()); + chat_bufferlen = strlen(chat_buffer); + } } /* -- 2.39.2