Add Drop to floor flag for item_generic

This commit is contained in:
Roman Chistokhodov 2019-09-03 16:55:14 +03:00
parent 6e7bf80d08
commit f115d3105e

View File

@ -21,6 +21,8 @@
//=========================================================
// Generic item
//=========================================================
#define SF_ITEM_GENERIC_DROP_TO_FLOOR 1
class CItemGeneric : public CBaseAnimating
{
public:
@ -62,6 +64,15 @@ void CItemGeneric::Spawn(void)
// Call startup sequence to look for a sequence to play.
SetThink(&CItemGeneric::StartupThink);
pev->nextthink = gpGlobals->time + 0.1f;
if (FBitSet(pev->spawnflags, SF_ITEM_GENERIC_DROP_TO_FLOOR))
{
if( DROP_TO_FLOOR(ENT( pev ) ) == 0 )
{
ALERT(at_error, "Item %s fell out of level at %f,%f,%f\n", STRING( pev->classname ), pev->origin.x, pev->origin.y, pev->origin.z);
UTIL_Remove( this );
}
}
}
void CItemGeneric::Precache(void)