Add damageCustom argument to SDKHooks_TakeDamage native.
This commit is contained in:
parent
4c4629fca7
commit
64b3c8fbd8
@ -175,7 +175,13 @@ cell_t Native_TakeDamage(IPluginContext *pContext, const cell_t *params)
|
|||||||
vecDamagePosition = vec3_origin;
|
vecDamagePosition = vec3_origin;
|
||||||
}
|
}
|
||||||
|
|
||||||
CTakeDamageInfoHack info(pInflictor, pAttacker, flDamage, iDamageType, pWeapon, vecDamageForce, vecDamagePosition);
|
int iDamageCustom = 0;
|
||||||
|
if (params[0] >= 9)
|
||||||
|
{
|
||||||
|
iDamageCustom = params[9];
|
||||||
|
}
|
||||||
|
|
||||||
|
CTakeDamageInfoHack info(pInflictor, pAttacker, flDamage, iDamageType, pWeapon, vecDamageForce, vecDamagePosition, iDamageCustom);
|
||||||
SH_MCALL(pVictim, OnTakeDamage)((CTakeDamageInfoHack &)info);
|
SH_MCALL(pVictim, OnTakeDamage)((CTakeDamageInfoHack &)info);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@
|
|||||||
|
|
||||||
CTakeDamageInfo::CTakeDamageInfo(){}
|
CTakeDamageInfo::CTakeDamageInfo(){}
|
||||||
|
|
||||||
CTakeDamageInfoHack::CTakeDamageInfoHack( CBaseEntity *pInflictor, CBaseEntity *pAttacker, float flDamage, int bitsDamageType, CBaseEntity *pWeapon, Vector vecDamageForce, Vector vecDamagePosition )
|
CTakeDamageInfoHack::CTakeDamageInfoHack( CBaseEntity *pInflictor, CBaseEntity *pAttacker, float flDamage, int bitsDamageType, CBaseEntity *pWeapon, Vector vecDamageForce, Vector vecDamagePosition, int iDamageCustom )
|
||||||
{
|
{
|
||||||
m_hInflictor = pInflictor;
|
m_hInflictor = pInflictor;
|
||||||
if ( pAttacker )
|
if ( pAttacker )
|
||||||
@ -63,9 +63,9 @@ CTakeDamageInfoHack::CTakeDamageInfoHack( CBaseEntity *pInflictor, CBaseEntity *
|
|||||||
m_iAmmoType = -1;
|
m_iAmmoType = -1;
|
||||||
|
|
||||||
#if SOURCE_ENGINE < SE_ORANGEBOX
|
#if SOURCE_ENGINE < SE_ORANGEBOX
|
||||||
m_iCustomKillType = 0;
|
m_iCustomKillType = iDamageCustom;
|
||||||
#else
|
#else
|
||||||
m_iDamageCustom = 0;
|
m_iDamageCustom = iDamageCustom;
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 \
|
#if SOURCE_ENGINE == SE_CSS || SOURCE_ENGINE == SE_HL2DM || SOURCE_ENGINE == SE_DODS || SOURCE_ENGINE == SE_SDK2013 \
|
||||||
|
@ -58,7 +58,7 @@
|
|||||||
class CTakeDamageInfoHack : public CTakeDamageInfo
|
class CTakeDamageInfoHack : public CTakeDamageInfo
|
||||||
{
|
{
|
||||||
public:
|
public:
|
||||||
CTakeDamageInfoHack( CBaseEntity *pInflictor, CBaseEntity *pAttacker, float flDamage, int bitsDamageType, CBaseEntity *pWeapon, Vector vecDamageForce, Vector vecDamagePosition );
|
CTakeDamageInfoHack( CBaseEntity *pInflictor, CBaseEntity *pAttacker, float flDamage, int bitsDamageType, CBaseEntity *pWeapon, Vector vecDamageForce, Vector vecDamagePosition, int iDamageCustom=0);
|
||||||
inline int GetAttacker() const { return m_hAttacker.IsValid() ? m_hAttacker.GetEntryIndex() : -1; }
|
inline int GetAttacker() const { return m_hAttacker.IsValid() ? m_hAttacker.GetEntryIndex() : -1; }
|
||||||
inline int GetInflictor() const { return m_hInflictor.IsValid() ? m_hInflictor.GetEntryIndex() : -1; }
|
inline int GetInflictor() const { return m_hInflictor.IsValid() ? m_hInflictor.GetEntryIndex() : -1; }
|
||||||
#if SOURCE_ENGINE >= SE_ORANGEBOX && SOURCE_ENGINE != SE_LEFT4DEAD
|
#if SOURCE_ENGINE >= SE_ORANGEBOX && SOURCE_ENGINE != SE_LEFT4DEAD
|
||||||
|
@ -408,10 +408,11 @@ native void SDKUnhook(int entity, SDKHookType type, SDKHookCB callback);
|
|||||||
* @param weapon Weapon index (orangebox and later) or -1 for unspecified
|
* @param weapon Weapon index (orangebox and later) or -1 for unspecified
|
||||||
* @param damageForce Velocity of damage force
|
* @param damageForce Velocity of damage force
|
||||||
* @param damagePosition Origin of damage
|
* @param damagePosition Origin of damage
|
||||||
|
* @param damageCustom User custom
|
||||||
*/
|
*/
|
||||||
native void SDKHooks_TakeDamage(int entity, int inflictor, int attacker,
|
native void SDKHooks_TakeDamage(int entity, int inflictor, int attacker,
|
||||||
float damage, int damageType=DMG_GENERIC, int weapon=-1,
|
float damage, int damageType=DMG_GENERIC, int weapon=-1,
|
||||||
const float damageForce[3]=NULL_VECTOR, const float damagePosition[3]=NULL_VECTOR);
|
const float damageForce[3]=NULL_VECTOR, const float damagePosition[3]=NULL_VECTOR, int damageCustom=0);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Forces a client to drop the specified weapon
|
* Forces a client to drop the specified weapon
|
||||||
|
Loading…
Reference in New Issue
Block a user