From: <web...@pr...> - 2017-11-18 19:54:22
|
Author: rjy Date: Sat Nov 18 19:13:28 2017 New Revision: 4529 Log: comperr_freeaim: override autoaim With this turning on the "Allow Vertical Aiming" option disables autoaim for bullet and missile player weapons. I think this is what most players will expect, that with vertical aiming they have full control over where to put their shots without Doom's autoaim interfering at all. Requested by OldManRage on Doomworld: https://www.doomworld.com/vb/post/1817858 Note this does not apply to BFG tracers or melee attacks (fist/chainsaw) Modified: branches/prboom-plus-24/prboom2/src/p_mobj.c branches/prboom-plus-24/prboom2/src/p_pspr.c Modified: branches/prboom-plus-24/prboom2/src/p_mobj.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/p_mobj.c Mon Sep 18 07:40:58 2017 (r4528) +++ branches/prboom-plus-24/prboom2/src/p_mobj.c Sat Nov 18 19:13:28 2017 (r4529) @@ -1611,6 +1611,9 @@ angle_t an = source->angle; // killough 7/19/98: autoaiming was not in original beta + if (comperr(comperr_freeaim)) + slope = finetangent[(ANG90 - source->pitch) >> ANGLETOFINESHIFT]; + else { // killough 8/2/98: prefer autoaiming at enemies uint_64_t mask = mbf_features ? MF_FRIEND : 0; @@ -1626,9 +1629,6 @@ an = source->angle, slope = 0; } while (mask && (mask=0, !linetarget)); // killough 8/2/98 - - if (!linetarget && comperr(comperr_freeaim)) - slope = finetangent[(ANG90 - source->pitch) >> ANGLETOFINESHIFT]; } x = source->x; Modified: branches/prboom-plus-24/prboom2/src/p_pspr.c ============================================================================== --- branches/prboom-plus-24/prboom2/src/p_pspr.c Mon Sep 18 07:40:58 2017 (r4528) +++ branches/prboom-plus-24/prboom2/src/p_pspr.c Sat Nov 18 19:13:28 2017 (r4529) @@ -729,6 +729,10 @@ { angle_t an = mo->angle; // see which target is to be aimed at + if (comperr(comperr_freeaim)) + bulletslope = finetangent[(ANG90 - mo->pitch) >> ANGLETOFINESHIFT]; + else + { /* killough 8/2/98: make autoaiming prefer enemies */ uint_64_t mask = mbf_features ? MF_FRIEND : 0; @@ -741,9 +745,7 @@ bulletslope = P_AimLineAttack(mo, an -= 2<<26, 16*64*FRACUNIT, mask); } while (mask && (mask=0, !linetarget)); /* killough 8/2/98 */ - - if (!linetarget && comperr(comperr_freeaim)) - bulletslope = finetangent[(ANG90 - mo->pitch) >> ANGLETOFINESHIFT]; + } } // |