diff --git a/src/actor.h b/src/actor.h index 1b4e5ac91d..4bd19f1aaf 100644 --- a/src/actor.h +++ b/src/actor.h @@ -700,7 +700,7 @@ public: virtual bool Massacre (); // Transforms the actor into a finely-ground paste - bool Grind(bool items); + virtual bool Grind(bool items); // Is the other actor on my team? bool IsTeammate (AActor *other); diff --git a/src/g_shared/a_pickups.cpp b/src/g_shared/a_pickups.cpp index 89bfe30863..bba5cfdc79 100644 --- a/src/g_shared/a_pickups.cpp +++ b/src/g_shared/a_pickups.cpp @@ -515,6 +515,33 @@ void AInventory::BeginPlay () flags |= MF_DROPPED; // [RH] Items are dropped by default } +//=========================================================================== +// +// AInventory :: Grind +// +//=========================================================================== + +bool AInventory::Grind(bool items) +{ + // Does this grind request even care about items? + if (!items) + { + return false; + } + // Dropped items are normally destroyed by crushers. Set the DONTGIB flag, + // and they'll act like corpses with it set and be immune to crushers. + if (flags & MF_DROPPED) + { + if (!(flags3 & MF3_DONTGIB)) + { + Destroy(); + } + return false; + } + // Non-dropped items call the super method for compatibility. + return Super::Grind(items); +} + //=========================================================================== // // AInventory :: DoEffect diff --git a/src/g_shared/a_pickups.h b/src/g_shared/a_pickups.h index b31d4e2888..4be7100a8d 100644 --- a/src/g_shared/a_pickups.h +++ b/src/g_shared/a_pickups.h @@ -157,6 +157,7 @@ public: virtual bool SpecialDropAction (AActor *dropper); virtual bool DrawPowerup (int x, int y); virtual void DoEffect (); + virtual bool Grind(bool items); virtual const char *PickupMessage (); virtual void PlayPickupSound (AActor *toucher); diff --git a/src/p_mobj.cpp b/src/p_mobj.cpp index e0dc45adc1..9895d7a56d 100644 --- a/src/p_mobj.cpp +++ b/src/p_mobj.cpp @@ -998,7 +998,7 @@ bool AActor::Grind(bool items) // ZDoom behavior differs from standard as crushed corpses cannot be raised. // The reason for the change was originally because of a problem with players, // see rh_log entry for February 21, 1999. Don't know if it is still relevant. - if (state == NULL // Only use the default crushed state if: + if (state == NULL // Only use the default crushed state if: && !(flags & MF_NOBLOOD) // 1. the monster bleeeds, && (i_compatflags & COMPATF_CORPSEGIBS) // 2. the compat setting is on, && player == NULL) // 3. and the thing isn't a player. @@ -1086,13 +1086,6 @@ bool AActor::Grind(bool items) return false; // keep checking } - // crunch dropped items - if (flags & MF_DROPPED) - { - if (items) Destroy (); // Only destroy dropped items if wanted - return false; // keep checking - } - // killough 11/98: kill touchy things immediately if (flags6 & MF6_TOUCHY && (flags6 & MF6_ARMED || IsSentient())) {