mirror of
https://github.com/alliedmodders/hl2sdk.git
synced 2025-01-04 00:23:25 +08:00
Update CTakeDamageInfo from Source SDK 2013.
This commit is contained in:
parent
02a7e3c497
commit
dbe9d8ab8e
@ -61,6 +61,7 @@ void CTakeDamageInfo::Init( CBaseEntity *pInflictor, CBaseEntity *pAttacker, CBa
|
||||
m_iPlayerPenetrationCount = 0;
|
||||
m_flDamageBonus = 0.f;
|
||||
m_bForceFriendlyFire = false;
|
||||
m_flDamageForForce = 0.f;
|
||||
}
|
||||
|
||||
CTakeDamageInfo::CTakeDamageInfo()
|
||||
|
@ -55,7 +55,8 @@ public:
|
||||
void AddDamage( float flAddAmount );
|
||||
void SubtractDamage( float flSubtractAmount );
|
||||
float GetDamageBonus() const;
|
||||
void SetDamageBonus( float flBonus );
|
||||
CBaseEntity *GetDamageBonusProvider() const;
|
||||
void SetDamageBonus( float flBonus, CBaseEntity *pProvider = NULL );
|
||||
|
||||
float GetBaseDamage() const;
|
||||
bool BaseDamageIsValid() const;
|
||||
@ -63,6 +64,8 @@ public:
|
||||
Vector GetDamageForce() const;
|
||||
void SetDamageForce( const Vector &damageForce );
|
||||
void ScaleDamageForce( float flScaleAmount );
|
||||
float GetDamageForForceCalc() const;
|
||||
void SetDamageForForceCalc( const float flScaleAmount );
|
||||
|
||||
Vector GetDamagePosition() const;
|
||||
void SetDamagePosition( const Vector &damagePosition );
|
||||
@ -125,8 +128,11 @@ protected:
|
||||
int m_iDamagedOtherPlayers;
|
||||
int m_iPlayerPenetrationCount;
|
||||
float m_flDamageBonus; // Anything that increases damage (crit) - store the delta
|
||||
EHANDLE m_hDamageBonusProvider; // Who gave us the ability to do extra damage?
|
||||
bool m_bForceFriendlyFire; // Ideally this would be a dmg type, but we can't add more
|
||||
|
||||
float m_flDamageForForce;
|
||||
|
||||
DECLARE_SIMPLE_DATADESC();
|
||||
};
|
||||
|
||||
@ -247,9 +253,15 @@ inline float CTakeDamageInfo::GetDamageBonus() const
|
||||
return m_flDamageBonus;
|
||||
}
|
||||
|
||||
inline void CTakeDamageInfo::SetDamageBonus( float flBonus )
|
||||
inline CBaseEntity *CTakeDamageInfo::GetDamageBonusProvider() const
|
||||
{
|
||||
return m_hDamageBonusProvider;
|
||||
}
|
||||
|
||||
inline void CTakeDamageInfo::SetDamageBonus( float flBonus, CBaseEntity *pProvider /*= NULL*/ )
|
||||
{
|
||||
m_flDamageBonus = flBonus;
|
||||
m_hDamageBonusProvider = pProvider;
|
||||
}
|
||||
|
||||
inline float CTakeDamageInfo::GetBaseDamage() const
|
||||
@ -281,6 +293,16 @@ inline void CTakeDamageInfo::ScaleDamageForce( float flScaleAmount )
|
||||
m_vecDamageForce *= flScaleAmount;
|
||||
}
|
||||
|
||||
inline float CTakeDamageInfo::GetDamageForForceCalc() const
|
||||
{
|
||||
return m_flDamageForForce;
|
||||
}
|
||||
|
||||
inline void CTakeDamageInfo::SetDamageForForceCalc( float flDamage )
|
||||
{
|
||||
m_flDamageForForce = flDamage;
|
||||
}
|
||||
|
||||
inline Vector CTakeDamageInfo::GetDamagePosition() const
|
||||
{
|
||||
return m_vecDamagePosition;
|
||||
|
Loading…
x
Reference in New Issue
Block a user