make sure force_commandline in the console data gets set appropriatly

This commit is contained in:
Bill Currie 2002-01-20 00:04:50 +00:00
parent bb82e48ab1
commit 39d432b6a6
4 changed files with 19 additions and 3 deletions

View file

@ -37,6 +37,7 @@ static const char rcsid[] =
#include "QF/input.h"
#include "QF/keys.h"
#include "QF/msg.h"
#include "QF/plugin.h"
#include "QF/render.h"
#include "QF/screen.h"
#include "QF/skin.h"
@ -718,11 +719,15 @@ CL_SetState (cactive_t state)
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;
}
}

View file

@ -949,6 +949,7 @@ Host_Init (quakeparms_t *parms)
Con_Init ("client");
if (con_module) {
con_module->data->console->realtime = &realtime;
con_module->data->console->quit = Host_Quit_f;
}
GIB_Init ();

View file

@ -60,6 +60,8 @@ Host_Quit_f (void)
// M_Menu_Quit_f ();
// return;
// }
if (!con_module)
Con_Printf ("I hope you wanted to quit\n");
CL_Disconnect ();
Host_ShutdownServer (false);
@ -1355,7 +1357,8 @@ void
Host_InitCommands (void)
{
Cmd_AddCommand ("status", Host_Status_f, "No Description");
Cmd_AddCommand ("quit", Host_Quit_f, "No Description");
if (!con_module)
Cmd_AddCommand ("quit", Host_Quit_f, "No Description");
Cmd_AddCommand ("god", Host_God_f, "No Description");
Cmd_AddCommand ("notarget", Host_Notarget_f, "No Description");
Cmd_AddCommand ("fly", Host_Fly_f, "No Description");

View file

@ -243,7 +243,8 @@ CL_Quit_f (void)
// M_Menu_Quit_f ();
// return;
// }
Con_Printf ("I hope you wanted to quit\n");
if (!con_module)
Con_Printf ("I hope you wanted to quit\n");
CL_Disconnect ();
Sys_Quit ();
}
@ -1105,10 +1106,14 @@ CL_SetState (cactive_t state)
game_target = IMT_0;
key_dest = key_game;
IN_ClearStates ();
if (con_module)
con_module->data->console->force_commandline = 0;
} else {
r_active = false;
game_target = IMT_CONSOLE;
key_dest = key_console;
if (con_module)
con_module->data->console->force_commandline = 1;
}
}
@ -1153,7 +1158,8 @@ CL_Init (void)
Cmd_AddCommand ("skinlist", Con_Skinlist_f, "List skins available");
Cmd_AddCommand ("skyboxlist", Con_Skyboxlist_f, "List skyboxes available");
Cmd_AddCommand ("demolist", Con_Demolist_QWD_f, "List demos available");
Cmd_AddCommand ("quit", CL_Quit_f, "Exit the program");
if (!con_module)
Cmd_AddCommand ("quit", CL_Quit_f, "Exit the program");
Cmd_AddCommand ("connect", CL_Connect_f, "Connect to a server 'connect "
"hostname:port'");
Cmd_AddCommand ("reconnect", CL_Reconnect_f, "Reconnect to the last "
@ -1682,6 +1688,7 @@ Host_Init (void)
con_module->data->console->dl_name = cls.downloadname;
con_module->data->console->dl_percent = &cls.downloadpercent;
con_module->data->console->realtime = &realtime;
con_module->data->console->quit = CL_Quit_f;
}
NET_Init (cl_port->int_val);