Skip to content

Commit

Permalink
Add HITOWNER flag, when set, allows a projectile to collide with its …
Browse files Browse the repository at this point in the history
…shooter.
  • Loading branch information
Marisa Kirisame authored and coelckers committed Aug 17, 2018
1 parent 02926a5 commit 155afeb
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/actor.h
Expand Up @@ -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 ---
Expand Down
4 changes: 2 additions & 2 deletions src/p_map.cpp
Expand Up @@ -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;
}

Expand Down
1 change: 1 addition & 0 deletions src/scripting/thingdef_data.cpp
Expand Up @@ -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),
Expand Down

0 comments on commit 155afeb

Please sign in to comment.