From 60bc6a91db1ff324a6fefd2cf73490c1d0f781ff Mon Sep 17 00:00:00 2001 From: Spoike Date: Tue, 12 Mar 2013 23:18:12 +0000 Subject: [PATCH] ------------------------------------------------------------------------ r4245 | acceptthis | 2013-03-08 02:48:56 +0000 (Fri, 08 Mar 2013) | 2 lines rename cl_forcesplitclient to in_forcesplitclient. I can probably find it more easily then. binds for eg give are now sent to the server in the context of the correct split-client. ------------------------------------------------------------------------ git-svn-id: https://svn.code.sf.net/p/fteqw/code/trunk@4241 fc73d0e0-1445-4013-8a0c-d673dee63da5 --- engine/client/cl_input.c | 2 +- engine/common/cmd.c | 18 +++++++++++++++--- 2 files changed, 16 insertions(+), 4 deletions(-) diff --git a/engine/client/cl_input.c b/engine/client/cl_input.c index 201f86f0e..a1eb5606d 100644 --- a/engine/client/cl_input.c +++ b/engine/client/cl_input.c @@ -49,7 +49,7 @@ vec3_t mousemovements[MAX_SPLITS]; /*kinda a hack...*/ static int con_splitmodifier; -cvar_t cl_forcesplitclient = CVAR("cl_forcesplitclient", "0"); +cvar_t cl_forcesplitclient = CVAR("in_forcesplitclient", "0"); extern cvar_t cl_splitscreen; int CL_TargettedSplit(qboolean nowrap) { diff --git a/engine/common/cmd.c b/engine/common/cmd.c index ac1201d24..9f950936b 100644 --- a/engine/common/cmd.c +++ b/engine/common/cmd.c @@ -1823,6 +1823,7 @@ so when they are typed in at the console, they will need to be forwarded. */ void Cmd_ForwardToServer (void) { + int sp; if (cls.state == ca_disconnected) { if (cl_warncmd.ival) @@ -1841,10 +1842,21 @@ void Cmd_ForwardToServer (void) } #endif - if (Cmd_Argc() > 1) - CL_SendClientCommand(true, "%s %s", Cmd_Argv(0), Cmd_Args()); + sp = CL_TargettedSplit(false); + if (sp) + { + if (Cmd_Argc() > 1) + CL_SendClientCommand(true, "%i %s %s", sp+1, Cmd_Argv(0), Cmd_Args()); + else + CL_SendClientCommand(true, "%i %s", sp+1, Cmd_Argv(0)); + } else - CL_SendClientCommand(true, "%s", Cmd_Argv(0)); + { + if (Cmd_Argc() > 1) + CL_SendClientCommand(true, "%s %s", Cmd_Argv(0), Cmd_Args()); + else + CL_SendClientCommand(true, "%s", Cmd_Argv(0)); + } } // don't forward the first argument