]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Make side-scrolling aiming much more accurate and use regular crosshairs instead...
authorMario <mario@smbclan.net>
Sat, 20 Jan 2018 05:57:30 +0000 (15:57 +1000)
committerMario <mario@smbclan.net>
Sat, 20 Jan 2018 05:57:30 +0000 (15:57 +1000)
qcsrc/client/view.qc
qcsrc/common/viewloc.qc

index 95a437e926dac488d40dfe96b8e879c5df7bcaf7..6a294d5ad5d35322c4576e063a844bcc0da16a15 100644 (file)
@@ -979,7 +979,7 @@ void HUD_Crosshair(entity this)
        float f, i, j;
        vector v;
        if(!scoreboard_active && !camera_active && intermission != 2 && !STAT(GAME_STOPPED) &&
-               spectatee_status != -1 && !csqcplayer.viewloc && !MUTATOR_CALLHOOK(DrawCrosshair) &&
+               spectatee_status != -1 && (!csqcplayer.viewloc || (!spectatee_status && (csqcplayer.viewloc.spawnflags & VIEWLOC_FREEAIM))) && !MUTATOR_CALLHOOK(DrawCrosshair) &&
                !HUD_MinigameMenu_IsOpened() )
        {
                if (!autocvar_crosshair_enabled) // main toggle for crosshair rendering
@@ -1010,7 +1010,10 @@ void HUD_Crosshair(entity this)
                float shottype;
 
                // wcross_origin = '0.5 0 0' * vid_conwidth + '0 0.5 0' * vid_conheight;
-               wcross_origin = project_3d_to_2d(view_origin + max_shot_distance * view_forward);
+               if(csqcplayer.viewloc && (csqcplayer.viewloc.spawnflags & VIEWLOC_FREEAIM))
+                       wcross_origin = viewloc_mousepos;
+               else
+                       wcross_origin = project_3d_to_2d(view_origin + max_shot_distance * view_forward);
                wcross_origin.z = 0;
                if(autocvar_crosshair_hittest)
                {
@@ -1489,8 +1492,8 @@ void ViewLocation_Mouse()
        viewloc_mousepos.x = bound(0, viewloc_mousepos.x, vid_conwidth);
        viewloc_mousepos.y = bound(0, viewloc_mousepos.y, vid_conheight);
 
-       float cursor_alpha = 1 - autocvar__menu_alpha;
-       draw_cursor(viewloc_mousepos, '0.5 0.5 0', "/cursor_move", '1 1 1', cursor_alpha);
+       //float cursor_alpha = 1 - autocvar__menu_alpha;
+       //draw_cursor(viewloc_mousepos, '0.5 0.5 0', "/cursor_move", '1 1 1', cursor_alpha);
 }
 
 bool ov_enabled;
index 11dab52a30e6651d99cbf3b4527edebfea00226b..fd7937b5208d7f9dbd2f9aa9afcb2f99bacd99ad 100644 (file)
@@ -175,7 +175,7 @@ void viewloc_SetViewLocation()
                        } else {
                                vector mpos = CursorToWorldCoord(viewloc_mousepos);
                                mpos.x = view.origin.x; // replace the cursor's x position with the player's
-                               view_angle = aim_vec(view.origin, mpos); // get new angles
+                               view_angle = aim_vec(view.origin + view.view_ofs, mpos); // get new angles
                        }
                        view.angles_y = view_angle.y;
                        setproperty(VF_CL_VIEWANGLES, view_angle);