diff --git a/src/actor.h b/src/actor.h index 88cfa983e5..288eb3129a 100644 --- a/src/actor.h +++ b/src/actor.h @@ -350,6 +350,9 @@ enum MF7_THRUREFLECT = 0x00000800, // Actors who are reflective cause the missiles to not slow down or change angles. MF7_MIRRORREFLECT = 0x00001000, // Actor is turned directly 180 degrees around when reflected. MF7_AIMREFLECT = 0x00002000, // Actor is directly reflected straight back at the one who fired the projectile. + MF7_HITTARGET = 0x00004000, // The actor the projectile dies on is set to target, provided it's targetable anyway. + MF7_HITMASTER = 0x00008000, // Same as HITTARGET, except it's master instead of target. + MF7_HITTRACER = 0x00010000, // Same as HITTARGET, but for tracer. diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index 2da365d600..39d1ba12d8 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -1202,6 +1202,9 @@ void P_ExplodeMissile (AActor *mo, line_t *line, AActor *target) if (target != NULL && ((target->flags & (MF_SHOOTABLE|MF_CORPSE)) || (target->flags6 & MF6_KILLED)) ) { + if (target->flags7 & MF7_HITTARGET) mo->target = target; + if (target->flags7 & MF7_HITMASTER) mo->master = target; + if (target->flags7 & MF7_HITTRACER) mo->tracer = target; if (target->flags & MF_NOBLOOD) nextstate = mo->FindState(NAME_Crash); if (nextstate == NULL) nextstate = mo->FindState(NAME_Death, NAME_Extreme); } diff --git a/src/thingdef/thingdef_data.cpp b/src/thingdef/thingdef_data.cpp index 0bc7624a73..fbe28fb5bf 100644 --- a/src/thingdef/thingdef_data.cpp +++ b/src/thingdef/thingdef_data.cpp @@ -250,6 +250,9 @@ static FFlagDef ActorFlags[]= DEFINE_FLAG(MF7, THRUREFLECT, AActor, flags7), DEFINE_FLAG(MF7, MIRRORREFLECT, AActor, flags7), DEFINE_FLAG(MF7, AIMREFLECT, AActor, flags7), + DEFINE_FLAG(MF7, HITTARGET, AActor, flags7), + DEFINE_FLAG(MF7, HITMASTER, AActor, flags7), + DEFINE_FLAG(MF7, HITTRACER, AActor, flags7), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),