Skip to content

Commit

Permalink
Fixed jHeretic autoaiming.
Browse files Browse the repository at this point in the history
  • Loading branch information
skyjake committed Dec 23, 2006
1 parent a9e9212 commit 230ef97
Showing 1 changed file with 16 additions and 13 deletions.
29 changes: 16 additions & 13 deletions doomsday/plugins/jheretic/src/p_pspr.c
Expand Up @@ -1145,30 +1145,33 @@ void C_DECL A_Raise(player_t *player, pspdef_t * psp)
*/
void P_BulletSlope(mobj_t *mo)
{
angle_t an;
boolean dontAim = cfg.noAutoAim;
angle_t an = mo->angle;

// see which target is to be aimed at
an = mo->angle;
bulletslope = P_AimLineAttack(mo, an, 16 * 64 * FRACUNIT);
if(!cfg.noAutoAim)
if(!cfg.noAutoAim) // Autoaiming enabled.
{
// See which target is to be aimed at.
bulletslope = P_AimLineAttack(mo, an, 16 * 64 * FRACUNIT);
if(!linetarget)
{
// No target yet, look closer.
an += 1 << 26;
bulletslope = P_AimLineAttack(mo, an, 16 * 64 * FRACUNIT);
if(!linetarget)
{
an -= 2 << 26;
bulletslope = P_AimLineAttack(mo, an, 16 * 64 * FRACUNIT);
}

if(!linetarget)
{
an += 2 << 26;
bulletslope =
FRACUNIT * (tan(LOOKDIR2RAD(mo->dplayer->lookdir)) / 1.2);
}
}
if(linetarget)
{
// Found a target, we're done.
return;
}
}

// Fall back to manual aiming by lookdir.
bulletslope =
FRACUNIT * (tan(LOOKDIR2RAD(mo->dplayer->lookdir)) / 1.2);
}

void C_DECL A_BeakAttackPL1(player_t *player, pspdef_t * psp)
Expand Down

0 comments on commit 230ef97

Please sign in to comment.