Called when the entity is taking damage.
This hook is only called for
1 CTakeDamageInfo damage
The damage to be applied to the entity.
How much damage the entity took. Basically
> 0means took damage,
0means did not take damage.
All damage taken by this entity is applied twice. This will count the damage taken as two distinctive hits as opposed to just scaling it in GM:EntityTakeDamage.
function ENT:OnTakeDamage( dmginfo ) -- Make sure we're not already applying damage a second time -- This prevents infinite loops if ( not self.m_bApplyingDamage ) then self.m_bApplyingDamage = true self:TakeDamageInfo( dmginfo ) self.m_bApplyingDamage = false end end