From: divverent Date: Wed, 17 Aug 2011 07:42:33 +0000 (+0000) Subject: allow extra args for messagemode and messagemode2 to prefill a message prefix X-Git-Tag: xonotic-v0.6.0~163^2~270 X-Git-Url: http://git.xonotic.org/?p=xonotic%2Fdarkplaces.git;a=commitdiff_plain;h=6d472eb4b897879d92a89416a5785a3fc78da3e7 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 --- 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); + } } /*