fix nq-servers non-curses console input so it actually works

This commit is contained in:
Bill Currie 2003-04-16 04:07:55 +00:00
parent 53a0c9df98
commit f55bac4c06
3 changed files with 9 additions and 5 deletions

View file

@ -533,12 +533,13 @@ Sys_CheckInput (int idle, int net_socket)
FD_ZERO (&fdset);
if (do_stdin)
FD_SET (0, &fdset);
FD_SET (net_socket, &fdset);
if (net_socket >= 0)
FD_SET (net_socket, &fdset);
if (!idle || !sys_dead_sleep->int_val)
timeout = &_timeout;
res = select (net_socket + 1, &fdset, NULL, NULL, timeout);
res = select (max (net_socket, 0) + 1, &fdset, NULL, NULL, timeout);
if (res == 0 || res == -1)
return 0;
stdin_ready = FD_ISSET (0, &fdset);

View file

@ -601,6 +601,9 @@ _Host_Frame (float time)
IN_ProcessEvents ();
// process gib threads
// check for commands typed to the host
Host_GetConsoleCommands ();
GIB_Thread_Execute ();
@ -620,9 +623,6 @@ _Host_Frame (float time)
//
//-------------------
// check for commands typed to the host
Host_GetConsoleCommands ();
if (sv.active)
Host_ServerFrame ();

View file

@ -108,6 +108,9 @@ main (int argc, const char **argv)
oldtime = Sys_DoubleTime () - 0.1;
while (1) { // Main message loop
if (!Sys_CheckInput (0, -1))
continue;
// find time spent rendering last frame
newtime = Sys_DoubleTime ();
time = newtime - oldtime;