CFuncRotating::HurtTouch
0x00630df0 · 340 bytes · __thiscall
_ZN13CFuncRotating9HurtTouchEP11CBaseEntity
Decompiled
undefined (2 params)
/* CFuncRotating::HurtTouch(CBaseEntity*) */
void __thiscall CFuncRotating::HurtTouch(CFuncRotating *this,CBaseEntity *param_1)
{
float *pfVar1;
float fVar2;
float local_7c;
float local_78;
float local_74;
if (param_1[0x105] == (CBaseEntity)0x0) {
return;
}
fVar2 = SQRT(*(float *)(this + 0x284) * *(float *)(this + 0x284) +
*(float *)(this + 0x280) * *(float *)(this + 0x280) +
*(float *)(this + 0x288) * *(float *)(this + 0x288)) * 0.1;
*(float *)(this + 0x460) = fVar2;
CTakeDamageInfo::CTakeDamageInfo
((CTakeDamageInfo *)&local_7c,(CBaseEntity *)this,(CBaseEntity *)this,fVar2,1,0);
CBaseEntity::TakeDamage(param_1,(CTakeDamageInfo *)&local_7c);
pfVar1 = (float *)(**(code **)(*(int *)this + 0x288))(this);
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
local_7c = *(float *)(param_1 + 0x2e0) - *pfVar1;
local_78 = *(float *)(param_1 + 0x2e4) - pfVar1[1];
local_74 = *(float *)(param_1 + 0x2e8) - pfVar1[2];
VectorNormalize((Vector *)&local_7c);
fVar2 = *(float *)(this + 0x460);
local_7c = local_7c * fVar2;
local_78 = local_78 * fVar2;
local_74 = fVar2 * local_74;
CBaseEntity::SetAbsVelocity(param_1,(Vector *)&local_7c);
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.