// client console can see server cvars because the user may start a server
cmd_client.cvars = &cvars_all;
cmd_client.cvars_flagsmask = CVAR_CLIENT | CVAR_SERVER;
- cmd_client.cmd_flags = CMD_CLIENT | CMD_CLIENT_FROM_SERVER;
+ cmd_client.cmd_flags = CMD_CLIENT | CMD_CLIENT_FROM_SERVER | CMD_SERVER_FROM_CLIENT;
cmd_client.userdefined = &cmd_userdefined_all;
// dedicated server console can only see server cvars, there is no client
cmd_server.cvars = &cvars_all;
cmd_function_t *func;
cmd_function_t *prev, *current;
cmd_state_t *cmd;
+ xcommand_t save = NULL;
int i;
for (i = 0; i < 3; i++)
cmd = cmd_iter_all[i].cmd;
if (flags & cmd->cmd_flags)
{
+ if(cmd == &cmd_client && (flags & CMD_SERVER_FROM_CLIENT) && !(flags & CMD_CLIENT))
+ {
+ save = function;
+ function = Cmd_ForwardToServer_f;
+ }
// fail if the command is a variable name
if (Cvar_FindVar(cmd->cvars, cmd_name, ~0))
{
{
if (!strcmp(cmd_name, func->name))
{
- // Allow overriding forward to server
- if(func->function == Cmd_ForwardToServer_f && (func->flags & 8))
- break;
- else
- {
- Con_Printf("Cmd_AddCommand: %s already defined\n", cmd_name);
- goto nested_continue;
- }
+ Con_Printf("Cmd_AddCommand: %s already defined\n", cmd_name);
+ goto next;
}
}
}
func->next = current;
}
+ if (save)
+ function = save;
}
-nested_continue:
+next:
continue;
}
}