CBaseEntity::TraceAttack
0x0040f4d0 · 285 bytes · __thiscall
_ZN11CBaseEntity11TraceAttackERK15CTakeDamageInfoRK6VectorP10CGameTrace
Decompiled
undefined (4 params)
/* CBaseEntity::TraceAttack(CTakeDamageInfo const&, Vector const&, CGameTrace*) */
void __thiscall
CBaseEntity::TraceAttack
(CBaseEntity *this,CTakeDamageInfo *param_1,Vector *param_2,CGameTrace *param_3)
{
float fVar1;
float fVar2;
float fVar3;
float fVar4;
float fVar5;
float fVar6;
int iVar7;
float local_28;
float local_24;
float local_20;
fVar1 = *(float *)param_2;
fVar2 = *(float *)(param_2 + 4);
fVar3 = *(float *)(param_2 + 8);
fVar4 = *(float *)(param_3 + 0xc);
fVar5 = *(float *)(param_3 + 0x10);
fVar6 = *(float *)(param_3 + 0x14);
if (this[0x105] != (CBaseEntity)0x0) {
AddMultiDamage(param_1,this);
iVar7 = (**(code **)(*(int *)this + 0x138))(this);
if (iVar7 != -1) {
local_28 = fVar4 - fVar1 * 4.0;
local_24 = fVar5 - fVar2 * 4.0;
local_20 = fVar6 - fVar3 * 4.0;
UTIL_BloodDrips((Vector *)&local_28,param_2,iVar7,(int)*(float *)(param_1 + 0x3c));
TraceBleed(this,*(float *)(param_1 + 0x3c),param_2,param_3,*(int *)(param_1 + 0x48));
return;
}
}
return;
}
SourceMod gamedata
paste intoaddons/sourcemod/gamedata/<your_plugin>.txt
used as the SourceMod key — change to fit your plugin's convention
SourceMod library name (server / engine / matchmaking)
Just a Signatures{} block, ready to drop into a gamedata
file. Wire it up in your plugin however you like - SDKCall, DHooks,
raw memory ops, or anything else.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.