]> git.xonotic.org Git - xonotic/darkplaces.git/blobdiff - cl_input.c
physics: fix and refactor unsticking
[xonotic/darkplaces.git] / cl_input.c
index 505bc1a29555fdbd134e935abd82d9e37afa35ce..21c2ad6435e7049b3795e87dbe8342001b6e7f6d 100644 (file)
@@ -211,7 +211,7 @@ static void IN_BestWeapon_Register(const char *name, int impulse, int weaponbit,
                Con_Printf("no slot left for weapon definition; increase IN_BESTWEAPON_MAX\n");
                return; // sorry
        }
-       strlcpy(in_bestweapon_info[i].name, name, sizeof(in_bestweapon_info[i].name));
+       dp_strlcpy(in_bestweapon_info[i].name, name, sizeof(in_bestweapon_info[i].name));
        in_bestweapon_info[i].impulse = impulse;
        if(weaponbit != -1)
                in_bestweapon_info[i].weaponbit = weaponbit;
@@ -527,7 +527,7 @@ void CL_Input (void)
        IN_Move ();
 
        // send mouse move to csqc
-       if (cl.csqc_loaded && cl_csqc_generatemousemoveevents.integer)
+       if (CLVM_prog->loaded && cl_csqc_generatemousemoveevents.integer)
        {
                if (cl.csqc_wantsmousemove)
                {
@@ -535,7 +535,7 @@ void CL_Input (void)
                        static int oldwindowmouse[2];
                        if (oldwindowmouse[0] != in_windowmouse_x || oldwindowmouse[1] != in_windowmouse_y)
                        {
-                               CL_VM_InputEvent(3, in_windowmouse_x * vid_conwidth.value / vid.width, in_windowmouse_y * vid_conheight.value / vid.height);
+                               CL_VM_InputEvent(3, in_windowmouse_x * vid_conwidth.value / vid.mode.width, in_windowmouse_y * vid_conheight.value / vid.mode.height);
                                oldwindowmouse[0] = in_windowmouse_x;
                                oldwindowmouse[1] = in_windowmouse_y;
                        }
@@ -704,8 +704,8 @@ void CL_Input (void)
                // mouse interacting with the scene, mostly stationary view
                V_StopPitchDrift();
                // update prydon cursor
-               cl.cmd.cursor_screen[0] = in_windowmouse_x * 2.0 / vid.width - 1.0;
-               cl.cmd.cursor_screen[1] = in_windowmouse_y * 2.0 / vid.height - 1.0;
+               cl.cmd.cursor_screen[0] = in_windowmouse_x * 2.0 / vid.mode.width - 1.0;
+               cl.cmd.cursor_screen[1] = in_windowmouse_y * 2.0 / vid.mode.height - 1.0;
        }
 
        if(v_flipped.integer)