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
1 changed files with 13 additions and 13 deletions

View File

@ -4754,11 +4754,18 @@ AActor *P_LineAttack(AActor *t1, DAngle angle, double distance,
// We must pass the unreplaced puff type here // 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); puff = P_SpawnPuff(t1, pufftype, bleedpos, trace.SrcAngleFromTarget, trace.SrcAngleFromTarget - 90, 2, puffFlags | PF_HITTHING, trace.Actor);
}
if (nointeract) if (victim != NULL)
{ {
return puff; 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. // Allow puffs to inflict poison damage, so that hitscans can poison, too.
@ -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); 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) if (trace.Crossed3DWater || trace.CrossedWater)
{ {