[console] Fix missed changes to console line exec control

I think I'd gotten distracted while making the changes to the server,
then simply copied the partial changes to the client. It didn't blow up
thanks to the backing store bing char * and the type sized for int, so
safe on any platform, but useless as it wasn't connected properly.

It's actually pretty neat being able to directly, but safely, control a
function pointer via a cvar :)
This commit is contained in:
Bill Currie 2022-04-24 20:46:06 +09:00
parent bff0847761
commit bdb1192c13
2 changed files with 4 additions and 6 deletions

View File

@ -119,7 +119,7 @@ static cvar_t con_speed_cvar = {
static exprenum_t cl_conmode_enum;
static exprtype_t cl_conmode_type = {
.name = "cl_conmode",
.size = sizeof (int),
.size = sizeof (con_data.exec_line),
.data = &cl_conmode_enum,
.get_string = cexpr_enum_get_string,
};
@ -144,14 +144,13 @@ static exprenum_t cl_conmode_enum = {
&cl_conmode_type,
&cl_conmode_symtab,
};
static char *cl_conmode;
static cvar_t cl_conmode_cvar = {
.name = "cl_conmode",
.description =
"Set the console input mode (command, chat, rcon)",
.default_value = "command",
.flags = CVAR_ARCHIVE,
.value = { .type = &cl_conmode_type, .value = &cl_conmode },
.value = { .type = &cl_conmode_type, .value = &con_data.exec_line },
};
#define NUM_CON_TIMES 4

View File

@ -95,7 +95,7 @@ static cvar_t sv_logfile_cvar = {
static exprenum_t sv_conmode_enum;
static exprtype_t sv_conmode_type = {
.name = "sv_conmode",
.size = sizeof (int),
.size = sizeof (sv_con_data.exec_line),
.data = &sv_conmode_enum,
.get_string = cexpr_enum_get_string,
};
@ -117,14 +117,13 @@ static exprenum_t sv_conmode_enum = {
&sv_conmode_type,
&sv_conmode_symtab,
};
static char *sv_conmode;
static cvar_t sv_conmode_cvar = {
.name = "sv_conmode",
.description =
"Set the console input mode (command, chat)",
.default_value = "command",
.flags = CVAR_NONE,
.value = { .type = &sv_conmode_type, .value = &sv_conmode },
.value = { .type = &sv_conmode_type, .value = &sv_con_data.exec_line },
};
static int sv_use_curses;
static cvar_t sv_use_curses_cvar = {