diff --git a/src/playsim/actor.h b/src/playsim/actor.h index 583050bb569..2f461e10897 100644 --- a/src/playsim/actor.h +++ b/src/playsim/actor.h @@ -891,7 +891,7 @@ class AActor final : public DThinker // Called when bouncing to allow for custom behavior. // Returns -1 for normal behavior, 0 to stop, and 1 to keep going. // (virtual on the script side only) - int SpecialBounceHit(AActor* bounceMobj, line_t* bounceLine, secplane_t* bouncePlane); + int SpecialBounceHit(AActor* bounceMobj, line_t* bounceLine, secplane_t* bouncePlane, bool is3DFloor); // Returns true if it's okay to switch target to "other" after being attacked by it. bool CallOkayToSwitchTarget(AActor *other); diff --git a/src/playsim/p_map.cpp b/src/playsim/p_map.cpp index 04ffa12c062..949514f2a77 100644 --- a/src/playsim/p_map.cpp +++ b/src/playsim/p_map.cpp @@ -3608,7 +3608,7 @@ bool FSlide::BounceWall(AActor *mo) if (mo->flags & MF_MISSILE) { - switch (mo->SpecialBounceHit(nullptr, line, nullptr)) + switch (mo->SpecialBounceHit(nullptr, line, nullptr, false)) { case 1: return true; case 0: return false; @@ -3708,7 +3708,7 @@ bool P_BounceActor(AActor *mo, AActor *BlockingMobj, bool ontop) default: break; } - switch (mo->SpecialBounceHit(BlockingMobj, nullptr, nullptr)) + switch (mo->SpecialBounceHit(BlockingMobj, nullptr, nullptr, false)) { case 1: return true; case 0: return false; diff --git a/src/playsim/p_mobj.cpp b/src/playsim/p_mobj.cpp index 1552ed9f542..9700118504a 100644 --- a/src/playsim/p_mobj.cpp +++ b/src/playsim/p_mobj.cpp @@ -1743,7 +1743,7 @@ bool AActor::FloorBounceMissile (secplane_t &plane, bool is3DFloor) { if (flags & MF_MISSILE) { - switch (SpecialBounceHit(nullptr, nullptr, &plane)) + switch (SpecialBounceHit(nullptr, nullptr, &plane, is3DFloor)) { // This one is backwards for some reason... case 1: return false; @@ -3420,15 +3420,15 @@ int AActor::SpecialMissileHit (AActor *victim) } // This virtual method only exists on the script side. -int AActor::SpecialBounceHit(AActor* bounceMobj, line_t* bounceLine, secplane_t* bouncePlane) +int AActor::SpecialBounceHit(AActor* bounceMobj, line_t* bounceLine, secplane_t* bouncePlane, bool is3DFloor) { IFVIRTUAL(AActor, SpecialBounceHit) { - VMValue params[4] = { (DObject*)this, bounceMobj, bounceLine, bouncePlane }; + VMValue params[] = { (DObject*)this, bounceMobj, bounceLine, bouncePlane, is3DFloor }; VMReturn ret; int retval; ret.IntAt(&retval); - VMCall(func, params, 4, &ret, 1); + VMCall(func, params, 5, &ret, 1); return retval; } else return -1; diff --git a/wadsrc/static/zscript/actors/actor.zs b/wadsrc/static/zscript/actors/actor.zs index 0893c107f24..a809e674d9c 100644 --- a/wadsrc/static/zscript/actors/actor.zs +++ b/wadsrc/static/zscript/actors/actor.zs @@ -581,7 +581,7 @@ class Actor : Thinker native } // This is called when a missile bounces off something. - virtual int SpecialBounceHit(Actor bounceMobj, Line bounceLine, readonly bouncePlane) + virtual int SpecialBounceHit(Actor bounceMobj, Line bounceLine, readonly bouncePlane, bool is3DFloor = false) { return MHIT_DEFAULT; }