From c988a0b3a49a365237b6e2aadfab6ed297d02b86 Mon Sep 17 00:00:00 2001 From: Major Cooke Date: Fri, 7 Sep 2018 11:19:20 -0500 Subject: [PATCH] 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. --- src/p_map.cpp | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index dacc7ae8b..a44d37c72 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -4754,11 +4754,18 @@ 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 (nointeract) - { - return puff; - } + } + 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. @@ -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) {