- Dropped items with the DONTGIB flag set will no longer be destroyed by crushers.

SVN r4215 (trunk)
This commit is contained in:
Randy Heit 2013-04-16 17:55:17 +00:00
parent cbe11657f0
commit a5d770b433
4 changed files with 30 additions and 9 deletions

View file

@ -700,7 +700,7 @@ public:
virtual bool Massacre (); virtual bool Massacre ();
// Transforms the actor into a finely-ground paste // Transforms the actor into a finely-ground paste
bool Grind(bool items); virtual bool Grind(bool items);
// Is the other actor on my team? // Is the other actor on my team?
bool IsTeammate (AActor *other); bool IsTeammate (AActor *other);

View file

@ -515,6 +515,33 @@ void AInventory::BeginPlay ()
flags |= MF_DROPPED; // [RH] Items are dropped by default 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 // AInventory :: DoEffect

View file

@ -157,6 +157,7 @@ public:
virtual bool SpecialDropAction (AActor *dropper); virtual bool SpecialDropAction (AActor *dropper);
virtual bool DrawPowerup (int x, int y); virtual bool DrawPowerup (int x, int y);
virtual void DoEffect (); virtual void DoEffect ();
virtual bool Grind(bool items);
virtual const char *PickupMessage (); virtual const char *PickupMessage ();
virtual void PlayPickupSound (AActor *toucher); virtual void PlayPickupSound (AActor *toucher);

View file

@ -1086,13 +1086,6 @@ bool AActor::Grind(bool items)
return false; // keep checking 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 // killough 11/98: kill touchy things immediately
if (flags6 & MF6_TOUCHY && (flags6 & MF6_ARMED || IsSentient())) if (flags6 & MF6_TOUCHY && (flags6 & MF6_ARMED || IsSentient()))
{ {