- Changed P_SpawnPlayerMissile() to use the same height calculation as
P_(Aim)LineAttack(). - Added an AttackZOffset to PlayerPawn. This is the offset from the center of the player at which their attacks are fired and scales according to their crouched height. - Changed the version of P_SpawnPlayerMissile() that takes coordinates to use that location as an offset from the standard attack location rather than as an explicit attack location. SVN r498 (trunk)
This commit is contained in:
parent
e01ff5707c
commit
72643bece6
12 changed files with 81 additions and 26 deletions
|
|
@ -2667,7 +2667,15 @@ fixed_t P_AimLineAttack (AActor *t1, angle_t angle, fixed_t distance, fixed_t vr
|
|||
|
||||
x2 = t1->x + (distance>>FRACBITS)*finecosine[angle];
|
||||
y2 = t1->y + (distance>>FRACBITS)*finesine[angle];
|
||||
shootz = t1->z + (t1->height>>1) + 8*FRACUNIT;
|
||||
shootz = t1->z + (t1->height>>1) - t1->floorclip;
|
||||
if (t1->player != NULL)
|
||||
{
|
||||
shootz += FixedMul (t1->player->mo->AttackZOffset, t1->player->crouchfactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
shootz += 8*FRACUNIT;
|
||||
}
|
||||
|
||||
// can't shoot outside view angles
|
||||
if (vrange == 0)
|
||||
|
|
@ -2776,7 +2784,15 @@ void P_LineAttack (AActor *t1, angle_t angle, fixed_t distance,
|
|||
vy = FixedMul (finecosine[pitch], finesine[angle]);
|
||||
vz = -finesine[pitch];
|
||||
|
||||
shootz = t1->z - t1->floorclip + (t1->height>>1) + 8*FRACUNIT;
|
||||
shootz = t1->z - t1->floorclip + (t1->height>>1);
|
||||
if (t1->player != NULL)
|
||||
{
|
||||
shootz += FixedMul (t1->player->mo->AttackZOffset, t1->player->crouchfactor);
|
||||
}
|
||||
else
|
||||
{
|
||||
shootz += 8*FRACUNIT;
|
||||
}
|
||||
attackrange = distance;
|
||||
aimpitch = pitch;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue