fix the handling of escape when in the console before ever connecting

This commit is contained in:
Bill Currie 2002-08-27 08:33:21 +00:00
parent f1938f6b36
commit a0807c762f
2 changed files with 23 additions and 22 deletions

View file

@ -717,23 +717,26 @@ CL_SendCmd (void)
void
CL_SetState (cactive_t state)
{
cactive_t old_state = cls.state;
cls.state = state;
if (cls.state == ca_active) {
r_active = true;
game_target = IMT_0;
key_dest = key_game;
IN_ClearStates ();
VID_SetCaption ("");
if (con_module)
con_module->data->console->force_commandline = 0;
} else {
r_active = false;
game_target = IMT_CONSOLE;
key_dest = key_console;
VID_SetCaption ("Disconnected");
if (con_module)
con_module->data->console->force_commandline = 1;
if (old_state != state) {
if (state == ca_active) {
// entering active state
r_active = true;
game_target = IMT_0;
key_dest = key_game;
IN_ClearStates ();
VID_SetCaption ("");
} else if (old_state == ca_active) {
// leaving active state
r_active = false;
game_target = IMT_CONSOLE;
key_dest = key_console;
VID_SetCaption ("Disconnected");
}
}
if (con_module)
con_module->data->console->force_commandline = (state != ca_active);
}
void

View file

@ -1133,10 +1133,9 @@ CL_SetState (cactive_t state)
r_active = false;
game_target = IMT_CONSOLE;
key_dest = key_console;
if (con_module)
con_module->data->console->force_commandline = 1;
// Auto demo recorder stops here
if(cl_autorecord->int_val && cls.demorecording)
if (cl_autorecord->int_val && cls.demorecording)
CL_Stop_f ();
} else if (state == ca_active) {
// entering active state
@ -1146,15 +1145,14 @@ CL_SetState (cactive_t state)
game_target = IMT_0;
key_dest = key_game;
if (con_module)
con_module->data->console->force_commandline = 0;
// Auto demo recorder starts here
if(cl_autorecord->int_val && !cls.demoplayback
if (cl_autorecord->int_val && !cls.demoplayback
&& !cls.demorecording)
CL_Record (0);
}
}
if (con_module)
con_module->data->console->force_commandline = (state != ca_active);
}
void