From d2ef6d81da1194dd13e72f2df5b0dd0e1fe495a3 Mon Sep 17 00:00:00 2001 From: Randy Heit Date: Sun, 28 Apr 2013 03:45:19 +0000 Subject: [PATCH] - P_RailAttack() now checks the puff's MF3_FOILINVUL flag. SVN r4230 (trunk) --- src/p_map.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/p_map.cpp b/src/p_map.cpp index 803276d10d..657b90d83f 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -3886,6 +3886,7 @@ struct RailData { TArray RailHits; bool StopAtOne; + bool StopAtInvul; }; static ETraceStatus ProcessRailHit (FTraceResults &res, void *userdata) @@ -3897,7 +3898,7 @@ static ETraceStatus ProcessRailHit (FTraceResults &res, void *userdata) } // Invulnerable things completely block the shot - if (res.Actor->flags2 & MF2_INVULNERABLE) + if (data->StopAtInvul && res.Actor->flags2 & MF2_INVULNERABLE) { return TRACE_Stop; } @@ -3964,10 +3965,11 @@ void P_RailAttack (AActor *source, int damage, int offset_xy, fixed_t offset_z, int flags; - AActor *puffDefaults = puffclass == NULL ? NULL : GetDefaultByType (puffclass->GetReplacement()); + assert(puffclass != NULL); // Because we set it to a default above + AActor *puffDefaults = GetDefaultByType (puffclass->GetReplacement()); - if (puffDefaults != NULL && puffDefaults->flags6 & MF6_NOTRIGGER) flags = 0; - else flags = TRACE_PCross|TRACE_Impact; + flags = (puffDefaults->flags6 & MF6_NOTRIGGER) ? 0 : TRACE_PCross|TRACE_Impact; + rail_data.StopAtInvul = (puffDefaults->flags3 & MF3_FOILINVUL) ? false : true; Trace (x1, y1, shootz, source->Sector, vx, vy, vz, distance, MF_SHOOTABLE, ML_BLOCKEVERYTHING, source, trace,