From 7e4a996cd48f621e0274572c39d38afa18e6f4df Mon Sep 17 00:00:00 2001 From: MajorCooke Date: Fri, 14 Aug 2020 01:01:32 -0500 Subject: [PATCH] P_BounceActor now calls SpecialMissileHit before any other bouncing effects are processed. Return values are as such: (#1156) - 1: The missile will continue moving through the actor, and it's down to the modder to handle bouncing. - 0: The missile will explode. - Any other value will process a bouncing actor as normally done in the engine. --- src/playsim/p_map.cpp | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/playsim/p_map.cpp b/src/playsim/p_map.cpp index 450f09d5c..e96667ec0 100644 --- a/src/playsim/p_map.cpp +++ b/src/playsim/p_map.cpp @@ -3513,8 +3513,18 @@ bool P_BounceWall(AActor *mo) extern FRandom pr_bounce; bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop) { + if (mo && (mo->flags & MF_MISSILE) && BlockingMobj) + { + switch (mo->SpecialMissileHit(BlockingMobj)) + { + case 1: return true; + case 0: return false; + default: break; + } + } + //Don't go through all of this if the actor is reflective and wants things to pass through them. - if (BlockingMobj && ((BlockingMobj->flags2 & MF2_REFLECTIVE) && (BlockingMobj->flags7 & MF7_THRUREFLECT))) return true; + if (BlockingMobj && ((BlockingMobj->flags2 & MF2_REFLECTIVE) && (BlockingMobj->flags7 & MF7_THRUREFLECT))) return true; if (mo && BlockingMobj && ((mo->BounceFlags & BOUNCE_AllActors) || ((mo->flags & MF_MISSILE) && (!(mo->flags2 & MF2_RIP) || (BlockingMobj->flags5 & MF5_DONTRIP)