This PR adds natives for creating and applying custom CTakeDamageInfo parameters to entities using CBaseEntity::TakeDamage(). Plugins can use the GetGlobalDamageInfo native to specify custom parameters for use in TakeDamage.
CBaseEntity::TakeDamage was used over CBaseEntity::OnTakeDamage because it checks for damage filters and applies damage scaling before OnTakeDamage is called. In addition, not only is it used across the SDK, it's the recommended way of dealing damage to entities anyways. On the other hand, SDKHooks_OnTakeDamage bypasses that and calls CBaseEntity::OnTakeDamage directly.
Some other miscellaneous changes:
Added CBaseEntity::TakeDamage signature to gamedata
Imported Init and Set CTakeDamageInfo funcs from SDK
Fixed CTakeDamageInfo.Set/AddDamageType natives missing a parameter (reported by @Mikusch)
Fixed some CTakeDamageInfo natives not returning immediately after erroring
This PR adds natives for creating and applying custom CTakeDamageInfo parameters to entities using
CBaseEntity::TakeDamage()
. Plugins can use theGetGlobalDamageInfo
native to specify custom parameters for use in TakeDamage.CBaseEntity::TakeDamage
was used overCBaseEntity::OnTakeDamage
because it checks for damage filters and applies damage scaling before OnTakeDamage is called. In addition, not only is it used across the SDK, it's the recommended way of dealing damage to entities anyways. On the other hand,SDKHooks_OnTakeDamage
bypasses that and callsCBaseEntity::OnTakeDamage
directly.Some other miscellaneous changes:
CBaseEntity::TakeDamage
signature to gamedataCTakeDamageInfo
funcs from SDKCTakeDamageInfo.Set/AddDamageType
natives missing a parameter (reported by @Mikusch)CTakeDamageInfo
natives not returning immediately after erroring