Browse Source

Add Drop to floor flag for item_generic

opforfixed
Roman Chistokhodov 5 years ago
parent
commit
f115d3105e
  1. 11
      dlls/gearbox/generic_items.cpp

11
dlls/gearbox/generic_items.cpp

@ -21,6 +21,8 @@
//========================================================= //=========================================================
// Generic item // Generic item
//========================================================= //=========================================================
#define SF_ITEM_GENERIC_DROP_TO_FLOOR 1
class CItemGeneric : public CBaseAnimating class CItemGeneric : public CBaseAnimating
{ {
public: public:
@ -62,6 +64,15 @@ void CItemGeneric::Spawn(void)
// Call startup sequence to look for a sequence to play. // Call startup sequence to look for a sequence to play.
SetThink(&CItemGeneric::StartupThink); SetThink(&CItemGeneric::StartupThink);
pev->nextthink = gpGlobals->time + 0.1f; 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) void CItemGeneric::Precache(void)

Loading…
Cancel
Save