mirror of
https://github.com/YGGverse/hlsdk-portable.git
synced 2025-09-03 09:42:33 +00:00
Limit gib attacks
This commit is contained in:
parent
a8754de564
commit
1b811d5644
@ -726,7 +726,7 @@ void CGib :: BounceGibTouch ( CBaseEntity *pOther )
|
||||
}
|
||||
else
|
||||
{
|
||||
if ( pev->velocity.Length() > 300)
|
||||
if ( m_flNextAttack < gpGlobals->time && pev->velocity.Length() > 300 )
|
||||
{
|
||||
entvars_t *pevOwner = pev;
|
||||
if( pev->owner)
|
||||
@ -739,6 +739,7 @@ void CGib :: BounceGibTouch ( CBaseEntity *pOther )
|
||||
pOther->TraceAttack(pevOwner, dmg, gpGlobals->v_forward, &tr, DMG_CLUB);
|
||||
ApplyMultiDamage(pev, pevOwner);
|
||||
}
|
||||
m_flNextAttack = gpGlobals->time + 1.0; // debounce
|
||||
}
|
||||
if ( g_Language != LANGUAGE_GERMAN && m_cBloodDecals > 0 && m_bloodColor != DONT_BLEED )
|
||||
{
|
||||
@ -811,8 +812,8 @@ void CGib :: Spawn( const char *szGibModel )
|
||||
|
||||
pev->nextthink = gpGlobals->time + 4;
|
||||
m_lifeTime = 250;
|
||||
SetThink( &WaitTillLand );
|
||||
SetTouch( &BounceGibTouch );
|
||||
SetThink( &CGib::WaitTillLand );
|
||||
SetTouch( &CGib::BounceGibTouch );
|
||||
|
||||
m_material = matNone;
|
||||
m_cBloodDecals = 5;// how many blood decals this gib can place (1 per bounce until none remain).
|
||||
|
@ -162,6 +162,7 @@ public:
|
||||
return 700;
|
||||
}
|
||||
|
||||
float m_flNextAttack;
|
||||
int m_bloodColor;
|
||||
int m_cBloodDecals;
|
||||
int m_material;
|
||||
|
Loading…
x
Reference in New Issue
Block a user