]> de.git.xonotic.org Git - xonotic/darkplaces.git/commitdiff
ignore vid_restart commands in configs
authorhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 19 Nov 2003 08:50:19 +0000 (08:50 +0000)
committerhavoc <havoc@d7cf8633-e32d-0410-b094-e92efae38249>
Wed, 19 Nov 2003 08:50:19 +0000 (08:50 +0000)
git-svn-id: svn://svn.icculus.org/twilight/trunk/darkplaces@3658 d7cf8633-e32d-0410-b094-e92efae38249

vid_shared.c

index 55c7562bbb2a6f135d9942b5d44a4b77c1361fa3..c32497e31cea6e7a9678601cc03e4970755faf34 100644 (file)
@@ -528,13 +528,13 @@ void IN_ProcessMove(usercmd_t *cmd)
 {
        // get basic movement from keyboard
        CL_BaseMove(cmd);
-       
+
        // OS independent code
        IN_PreMove();
-       
+
        // allow mice or other external controllers to add to the move
        IN_Move(cmd);
-       
+
        // OS independent code
        IN_PostMove();
 }
@@ -563,9 +563,9 @@ void IN_Mouse(usercmd_t *cmd, float mx, float my)
        in_mouse_x = (float) mouse_x * vid.conwidth / vid.realwidth;
        in_mouse_y = (float) mouse_y * vid.conheight / vid.realheight;
 
-       // AK: eveything else is client stuff 
+       // AK: eveything else is client stuff
        // BTW, this should be seperated somewhen
-       if(!in_client_mouse) 
+       if(!in_client_mouse)
                return;
 
        // LordHavoc: viewzoom affects mouse sensitivity for sniping
@@ -750,8 +750,14 @@ static void VID_CloseSystems(void)
        R_Modules_Shutdown();
 }
 
+int vid_commandlinecheck = true;
+
 void VID_Restart_f(void)
 {
+       // don't crash if video hasn't started yet
+       if (vid_commandlinecheck)
+               return;
+
        Con_Printf("VID_Restart: changing from %s %dx%dx%dbpp, to %s %dx%dx%dbpp.\n",
                current_vid_fullscreen ? "fullscreen" : "window", current_vid_width, current_vid_height, current_vid_bitsperpixel,
                vid_fullscreen.integer ? "fullscreen" : "window", vid_width.integer, vid_height.integer, vid_bitsperpixel.integer);
@@ -765,7 +771,6 @@ void VID_Restart_f(void)
        VID_OpenSystems();
 }
 
-int vid_commandlinecheck = true;
 void VID_Open(void)
 {
        int i, width, height;