]> git.rm.cloudns.org Git - xonotic/darkplaces.git/commitdiff
allow extra args for messagemode and messagemode2 to prefill a message prefix
authordivverent <divverent@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 17 Aug 2011 07:42:33 +0000 (07:42 +0000)
committerRudolf Polzer <divVerent@xonotic.org>
Fri, 19 Aug 2011 04:51:02 +0000 (06:51 +0200)
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

index bb9c277d7a7848429e6fd7f305c79d5166af2a4c..48dcac3ddf6405878af9dda911f8b66e08c06cfb 100644 (file)
--- 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);
+       }
 }
 
 /*