Added STOPRAILS actor flag.

- An actor with this flag will prevent railgun shots from penetrating further.
This commit is contained in:
Major Cooke 2019-11-14 11:48:50 -06:00 committed by Christoph Oelckers
parent 703686beee
commit 0b0984b88e
3 changed files with 4 additions and 1 deletions

View file

@ -411,6 +411,7 @@ enum ActorFlag8
MF8_NOFRICTIONBOUNCE = 0x00000040, // don't bounce off walls when on icy floors
MF8_RETARGETAFTERSLAM = 0x00000080, // Forces jumping to the idle state after slamming into something
MF8_RECREATELIGHTS = 0x00000100, // Internal flag that signifies that the light attachments need to be recreated at the
MF8_STOPRAILS = 0x00000200, // [MC] Prevent rails from going further if an actor has this flag.
};
// --- mobj.renderflags ---

View file

@ -5127,7 +5127,8 @@ static ETraceStatus ProcessRailHit(FTraceResults &res, void *userdata)
{
data->count++;
}
return (data->StopAtOne || (data->limit && (data->count >= data->limit))) ? TRACE_Stop : TRACE_Continue;
return (data->StopAtOne || (data->limit && (data->count >= data->limit)) || (res.Actor->flags8 & MF8_STOPRAILS))
? TRACE_Stop : TRACE_Continue;
}
//==========================================================================

View file

@ -323,6 +323,7 @@ static FFlagDef ActorFlagDefs[]=
DEFINE_FLAG(MF8, NOFRICTION, AActor, flags8),
DEFINE_FLAG(MF8, NOFRICTIONBOUNCE, AActor, flags8),
DEFINE_FLAG(MF8, RETARGETAFTERSLAM, AActor, flags8),
DEFINE_FLAG(MF8, STOPRAILS, AActor, flags8),
// Effect flags
DEFINE_FLAG(FX, VISIBILITYPULSE, AActor, effects),