Permalink
Browse files

- explode bouncing objects directly inside P_BounceActor if the bounc…

…e count expired. The calling code is too messed up to handle this cleanly.
  • Loading branch information...
coelckers committed Jan 27, 2017
1 parent 08c2522 commit 1eb2c753288a8baf61535aed4c5d25f39013de7e
Showing with 8 additions and 1 deletion.
  1. +8 −1 src/p_map.cpp
@@ -3532,7 +3532,14 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop)
|| ((mo->flags6 & MF6_NOBOSSRIP) && (BlockingMobj->flags2 & MF2_BOSS))) && (BlockingMobj->flags2 & MF2_REFLECTIVE))
|| ((BlockingMobj->player == NULL) && (!(BlockingMobj->flags3 & MF3_ISMONSTER)))))
{
if (mo->bouncecount > 0 && --mo->bouncecount == 0) return false;
if (mo->bouncecount>0 && --mo->bouncecount == 0)
{
if (mo->flags & MF_MISSILE)
P_ExplodeMissile(mo, nullptr, nullptr);
else
mo->CallDie(nullptr, nullptr);
return true;
}
if (mo->flags7 & MF7_HITTARGET) mo->target = BlockingMobj;
if (mo->flags7 & MF7_HITMASTER) mo->master = BlockingMobj;

3 comments on commit 1eb2c75

@StrikerMan780

This comment has been minimized.

Contributor

StrikerMan780 replied Jan 27, 2017

I suggest a parameter for P_BounceActor called skipbouncecount. If set to true, it won't run this check / decrement the bounce count. The parameter would be used in the few places where decrementing the bounce count would break things. (Like outside of the exploding check.)

Might be a little cleaner.

@rautamiekka

This comment has been minimized.

rautamiekka replied Jan 27, 2017

^ What'd be the default for the param ?

@StrikerMan780

This comment has been minimized.

Contributor

StrikerMan780 replied Jan 27, 2017

default would be false.

Please sign in to comment.