- preparations for allowing hitscans through portals.

To allow processing the hit through an arbitrary portal without reference to the portal group table, P_AimLineAttack and P_LineAttack need to pass some more info than just the linetarget.
We need the relative positions of shooter and target within the visual reference of the other to calculate proper angles and we need to know if such a portal was crossed at all, because a few things, e.g. seeker missiles won't work with them.

- fixed setup of target acquisition for the Mage Staff.

The pre-acquired seeker target was never passed to the spawned projectiles.
This commit is contained in:
Christoph Oelckers 2016-03-01 16:38:45 +01:00
commit b4a002a07f
28 changed files with 331 additions and 279 deletions

View file

@ -919,20 +919,21 @@ DEFINE_ACTION_FUNCTION_PARAMS(AInventory, A_GunFlash)
// the height of the intended target
//
angle_t P_BulletSlope (AActor *mo, AActor **pLineTarget)
angle_t P_BulletSlope (AActor *mo, FTranslatedLineTarget *pLineTarget, int aimflags)
{
static const int angdiff[3] = { -(1<<26), 1<<26, 0 };
int i;
angle_t an;
angle_t pitch;
AActor *linetarget;
FTranslatedLineTarget scratch;
if (pLineTarget == NULL) pLineTarget = &scratch;
// see which target is to be aimed at
i = 2;
do
{
an = mo->angle + angdiff[i];
pitch = P_AimLineAttack (mo, an, 16*64*FRACUNIT, &linetarget);
pitch = P_AimLineAttack (mo, an, 16*64*FRACUNIT, pLineTarget, 0, aimflags);
if (mo->player != NULL &&
level.IsFreelookAllowed() &&
@ -940,11 +941,8 @@ angle_t P_BulletSlope (AActor *mo, AActor **pLineTarget)
{
break;
}
} while (linetarget == NULL && --i >= 0);
if (pLineTarget != NULL)
{
*pLineTarget = linetarget;
}
} while (pLineTarget->linetarget == NULL && --i >= 0);
return pitch;
}