mirror of
https://github.com/ZDoom/gzdoom.git
synced 2024-11-10 23:01:50 +00:00
- Dropped items with the DONTGIB flag set will no longer be destroyed by crushers.
SVN r4215 (trunk)
This commit is contained in:
parent
cbe11657f0
commit
a5d770b433
4 changed files with 30 additions and 9 deletions
|
@ -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);
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
|
@ -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()))
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue