Open Doclic opened 2 months ago
After doing a bit of digging, it seems that in CBaseEntity::TakeDamage
, damage_for_force_calc
is set before calling the hook, and it's retrieved after, but the retrieved value is not used anywhere.
Edit:
I spent a bit more time on reversing, and the CTakeDamageInfo
passed to CBaseEntity::OnTakeDamage
has m_flDamageForForce
properly set:
I wanted to try hooking to
OnTakeDamage
via a SourceMod plugin instead of a VScript, but SourceMod doesn't expose m_flDamageForForce
.
While reverse-engineering, I've also found that damage_custom
is effectively useless, reported in #4481.
The following vscript should, when executed, make all damage knock players back as if they took only one point of damage:
This however doesn't happen, damage force is still calculated normally, using
params.damage
.