From 155afebb65c7982c989becd16dafd8e75413469a Mon Sep 17 00:00:00 2001 From: Marisa Kirisame Date: Fri, 17 Aug 2018 19:03:50 +0200 Subject: [PATCH] Add HITOWNER flag, when set, allows a projectile to collide with its shooter. --- src/actor.h | 1 + src/p_map.cpp | 4 ++-- src/scripting/thingdef_data.cpp | 1 + 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/actor.h b/src/actor.h index 9c326fdc6..71295794a 100644 --- a/src/actor.h +++ b/src/actor.h @@ -403,6 +403,7 @@ enum ActorFlag8 MF8_INSCROLLSEC = 0x00000002, // actor is partially inside a scrolling sector MF8_BLOCKASPLAYER = 0x00000004, // actor is blocked by player-blocking lines even if not a player MF8_DONTFACETALKER = 0x00000008, // don't alter the angle to face the player in conversations + MF8_HITOWNER = 0x00000010, // projectile can hit the actor that fired it }; // --- mobj.renderflags --- diff --git a/src/p_map.cpp b/src/p_map.cpp index 2e3e24651..c43a739d4 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -1554,8 +1554,8 @@ bool PIT_CheckThing(FMultiBlockThingsIterator &it, FMultiBlockThingsIterator::Ch if (tm.thing->target != NULL) { - if (thing == tm.thing->target) - { // Don't missile self + if (thing == tm.thing->target && !(tm.thing->flags8 & MF8_HITOWNER)) + { // Don't missile self -- [MK] unless explicitly allowed return true; } diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index c0ef05e23..ca6bee2a4 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -318,6 +318,7 @@ static FFlagDef ActorFlagDefs[]= DEFINE_FLAG(MF8, FRIGHTENING, AActor, flags8), DEFINE_FLAG(MF8, BLOCKASPLAYER, AActor, flags8), DEFINE_FLAG(MF8, DONTFACETALKER, AActor, flags8), + DEFINE_FLAG(MF8, HITOWNER, AActor, flags8), // Effect flags DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),