From 07838f4c2a762a83fc1049eae1455ea6d7c33296 Mon Sep 17 00:00:00 2001 From: Cacodemon345 Date: Fri, 9 Nov 2018 15:19:40 +0600 Subject: [PATCH] BOUNCEONUNRIPPABLES flag; makes actors bounce on actors with DONTRIP flag --- src/actor.h | 1 + src/p_map.cpp | 3 ++- src/scripting/thingdef_data.cpp | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/actor.h b/src/actor.h index 248847e5b..ab4909bb0 100644 --- a/src/actor.h +++ b/src/actor.h @@ -487,6 +487,7 @@ enum ActorBounceFlag BOUNCE_AutoOffFloorOnly = 1<<13, // like BOUNCE_AutoOff, but only on floors BOUNCE_UseBounceState = 1<<14, // Use Bounce[.*] states BOUNCE_NotOnShootables = 1<<15, // do not bounce off shootable actors if we are a projectile. Explode instead. + BOUNCE_BounceOnUnrips = 1<<16, // projectile bounces on actors with DONTRIP BOUNCE_TypeMask = BOUNCE_Walls | BOUNCE_Floors | BOUNCE_Ceilings | BOUNCE_Actors | BOUNCE_AutoOff | BOUNCE_HereticType | BOUNCE_MBF, diff --git a/src/p_map.cpp b/src/p_map.cpp index cea1a33d6..e0b16ca2e 100644 --- a/src/p_map.cpp +++ b/src/p_map.cpp @@ -3642,7 +3642,8 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop) || ((BlockingMobj->player == NULL) && (!(BlockingMobj->flags3 & MF3_ISMONSTER))))) { // Rippers should not bounce off shootable actors, since they rip through them. - if ((mo->flags & MF_MISSILE) && (mo->flags2 & MF2_RIP) && BlockingMobj->flags & MF_SHOOTABLE) + if ((mo->flags & MF_MISSILE) && (mo->flags2 & MF2_RIP) && BlockingMobj->flags & MF_SHOOTABLE + && !(mo->BounceFlags & BOUNCE_BounceOnUnrips && BlockingMobj->flags5 & MF5_DONTRIP)) return true; if (BlockingMobj->flags & MF_SHOOTABLE && mo->BounceFlags & BOUNCE_NotOnShootables) diff --git a/src/scripting/thingdef_data.cpp b/src/scripting/thingdef_data.cpp index a10d05710..60200e765 100644 --- a/src/scripting/thingdef_data.cpp +++ b/src/scripting/thingdef_data.cpp @@ -359,6 +359,7 @@ static FFlagDef ActorFlagDefs[]= DEFINE_FLAG2(BOUNCE_AutoOffFloorOnly, BOUNCEAUTOOFFFLOORONLY, AActor, BounceFlags), DEFINE_FLAG2(BOUNCE_UseBounceState, USEBOUNCESTATE, AActor, BounceFlags), DEFINE_FLAG2(BOUNCE_NotOnShootables, DONTBOUNCEONSHOOTABLES, AActor, BounceFlags), + DEFINE_FLAG2(BOUNCE_BounceOnUnrips, BOUNCEONUNRIPPABLES, AActor, BounceFlags), }; // These won't be accessible through bitfield variables