]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
Fixed Win32 dedicated server input
authormolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 5 Apr 2004 06:45:47 +0000 (06:45 +0000)
committermolivier <molivier@d7cf8633-e32d-0410-b094-e92efae38249>
Mon, 5 Apr 2004 06:45:47 +0000 (06:45 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@4082 d7cf8633-e32d-0410-b094-e92efae38249

sys_linux.c
todo

index 9e8b155c25317973c075561bd9a98235a8661b73..ed68eec91fdb44c7e7f63865f037b40c49d16c63 100644 (file)
@@ -139,7 +139,7 @@ char *Sys_ConsoleInput(void)
        if (cls.state == ca_dedicated)
        {
                static char text[256];
-               int len = 0;
+               static int len = 0;
 #ifdef WIN32
                int c;
 
@@ -147,30 +147,30 @@ char *Sys_ConsoleInput(void)
                while (_kbhit ())
                {
                        c = _getch ();
-                       putch (c);
                        if (c == '\r')
                        {
-                               text[len] = 0;
+                               text[len] = '\0';
                                putch ('\n');
                                len = 0;
                                return text;
                        }
-                       if (c == 8)
+                       if (c == '\b')
                        {
                                if (len)
                                {
+                                       putch (c);
                                        putch (' ');
                                        putch (c);
                                        len--;
-                                       text[len] = 0;
                                }
                                continue;
                        }
-                       text[len] = c;
-                       len++;
-                       text[len] = 0;
-                       if (len == sizeof (text))
-                               len = 0;
+                       if (len < sizeof (text) - 1)
+                       {
+                               putch (c);
+                               text[len] = c;
+                               len++;
+                       }
                }
 #else
                fd_set fdset;
diff --git a/todo b/todo
index 79d7e5d69b61c6a70dd7a1c38c3335f8366d3057..e24b45e46ecde1958d15eb68198ab5257da0528e 100644 (file)
--- a/todo
+++ b/todo
@@ -389,7 +389,7 @@ f darkplaces: pointcontents crash when building harvester in gvb2? (yummyluv)
 4 darkplaces: add qw protocol support (making darkplaces work as a qwcl client) (tell Fuh)
 4 darkplaces: add traceboxwithcontents function (same as tracebox but adds the startcontents parameter) (LTH, SeienAbunae, http://forums.inside3d.com/showflat.pl?Board=Engine&Number=909 )
 4 darkplaces: add wav music playback (tell Joseph Caporale, tell Static_Fiend)
-4 darkplaces: figure out what is wrong with dedicated server console on win32 and fix it (and tell willis@deathmask.net)
+-n darkplaces: figure out what is wrong with dedicated server console on win32 and fix it (and tell willis@deathmask.net)
 4 darkplaces: ingame mod switching
 4 darkplaces: make hqbsp save mip textures to bsp if tga textures are found
 4 darkplaces: rewrite sound system! (FrikaC, Static_Fiend, SeienAbunae)