Allow LineAttack's LAF_NOINTERACT to fill FTranslatedLineTarget's information.

- Originally when the flag was made, LineAttack was not yet exported. This can now be benefitted directly from ZScript.
This commit is contained in:
Major Cooke 2018-09-07 11:19:20 -05:00 committed by Christoph Oelckers
parent 60f82d1eb9
commit c988a0b3a4

View file

@ -4754,12 +4754,19 @@ AActor *P_LineAttack(AActor *t1, DAngle angle, double distance,
// We must pass the unreplaced puff type here
puff = P_SpawnPuff(t1, pufftype, bleedpos, trace.SrcAngleFromTarget, trace.SrcAngleFromTarget - 90, 2, puffFlags | PF_HITTHING, trace.Actor);
}
if (victim != NULL)
{
victim->linetarget = trace.Actor;
victim->attackAngleFromSource = trace.SrcAngleFromTarget;
// With arbitrary portals this cannot be calculated so using the actual attack angle is the only option.
victim->angleFromSource = trace.unlinked ? victim->attackAngleFromSource : t1->AngleTo(trace.Actor);
victim->unlinked = trace.unlinked;
}
if (nointeract)
{
return puff;
}
}
// Allow puffs to inflict poison damage, so that hitscans can poison, too.
if (puffDefaults != NULL && puffDefaults->PoisonDamage > 0 && puffDefaults->PoisonDuration != INT_MIN)
@ -4833,14 +4840,7 @@ AActor *P_LineAttack(AActor *t1, DAngle angle, double distance,
P_TraceBleed(newdam > 0 ? newdam : damage, trace.HitPos, trace.Actor, trace.SrcAngleFromTarget, pitch);
}
}
if (victim != NULL)
{
victim->linetarget = trace.Actor;
victim->attackAngleFromSource = trace.SrcAngleFromTarget;
// With arbitrary portals this cannot be calculated so using the actual attack angle is the only option.
victim->angleFromSource = trace.unlinked? victim->attackAngleFromSource : t1->AngleTo(trace.Actor);
victim->unlinked = trace.unlinked;
}
}
if (trace.Crossed3DWater || trace.CrossedWater)
{