From: Mario Date: Sat, 20 Jan 2018 05:57:30 +0000 (+1000) Subject: Make side-scrolling aiming much more accurate and use regular crosshairs instead... X-Git-Tag: xonotic-v0.8.5~2382 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=74f0d13d69943529b73526a88c7e7121fd2536ee;p=xonotic%2Fxonotic-data.pk3dir.git Make side-scrolling aiming much more accurate and use regular crosshairs instead of a cursor --- diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 95a437e92..6a294d5ad 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -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; diff --git a/qcsrc/common/viewloc.qc b/qcsrc/common/viewloc.qc index 11dab52a3..fd7937b52 100644 --- a/qcsrc/common/viewloc.qc +++ b/qcsrc/common/viewloc.qc @@ -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);