- P_RailAttack() now checks the puff's MF3_FOILINVUL flag.

SVN r4230 (trunk)
This commit is contained in:
Randy Heit 2013-04-28 03:45:19 +00:00
parent 2dfb1dd92f
commit d2ef6d81da

View file

@ -3886,6 +3886,7 @@ struct RailData
{ {
TArray<SRailHit> RailHits; TArray<SRailHit> RailHits;
bool StopAtOne; bool StopAtOne;
bool StopAtInvul;
}; };
static ETraceStatus ProcessRailHit (FTraceResults &res, void *userdata) static ETraceStatus ProcessRailHit (FTraceResults &res, void *userdata)
@ -3897,7 +3898,7 @@ static ETraceStatus ProcessRailHit (FTraceResults &res, void *userdata)
} }
// Invulnerable things completely block the shot // Invulnerable things completely block the shot
if (res.Actor->flags2 & MF2_INVULNERABLE) if (data->StopAtInvul && res.Actor->flags2 & MF2_INVULNERABLE)
{ {
return TRACE_Stop; return TRACE_Stop;
} }
@ -3964,10 +3965,11 @@ void P_RailAttack (AActor *source, int damage, int offset_xy, fixed_t offset_z,
int flags; 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; flags = (puffDefaults->flags6 & MF6_NOTRIGGER) ? 0 : TRACE_PCross|TRACE_Impact;
else flags = TRACE_PCross|TRACE_Impact; rail_data.StopAtInvul = (puffDefaults->flags3 & MF3_FOILINVUL) ? false : true;
Trace (x1, y1, shootz, source->Sector, vx, vy, vz, Trace (x1, y1, shootz, source->Sector, vx, vy, vz,
distance, MF_SHOOTABLE, ML_BLOCKEVERYTHING, source, trace, distance, MF_SHOOTABLE, ML_BLOCKEVERYTHING, source, trace,