CBreakableSurface::OnTakeDamage
0x006b81e0 · 481 bytes · __thiscall
_ZN17CBreakableSurface12OnTakeDamageERK15CTakeDamageInfo
Decompiled
undefined (2 params)
/* CBreakableSurface::OnTakeDamage(CTakeDamageInfo const&) */
undefined4 __thiscall
CBreakableSurface::OnTakeDamage(CBreakableSurface *this,CTakeDamageInfo *param_1)
{
uint uVar1;
float *pfVar2;
undefined *puVar3;
CBaseEntity *this_00;
CBreakableSurface *in_stack_ffffffc4;
Vector *this_01;
CBaseEntity *in_stack_ffffffc8;
Vector *in_stack_ffffffcc;
float local_28;
float local_24;
float local_20;
if ((this[0x524] == (CBreakableSurface)0x0) && (*(int *)(param_1 + 0x48) == 1)) {
local_28 = *(float *)param_1;
local_24 = *(float *)(param_1 + 4);
local_20 = *(float *)(param_1 + 8);
LAB_006b833c:
Die(in_stack_ffffffc4,in_stack_ffffffc8,in_stack_ffffffcc);
return 0;
}
if (*(int *)(this + 0x528) == 0) {
if ((*(uint *)(param_1 + 0x48) & 0x40) == 0) {
if ((*(uint *)(param_1 + 0x48) & 4) != 0) {
local_28 = *(float *)param_1;
local_24 = *(float *)(param_1 + 4);
local_20 = *(float *)(param_1 + 8);
if (this[0x524] != (CBreakableSurface)0x0) {
return 0;
}
goto LAB_006b833c;
}
}
else {
this_00 = (CBaseEntity *)0x0;
pfVar2 = (float *)(**(code **)(*(int *)this + 0x288))(this);
uVar1 = *(uint *)(param_1 + 0x30);
if (((uVar1 != 0xffffffff) &&
(puVar3 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar3 != (undefined *)0xfffffffc)) &&
(*(uint *)(puVar3 + 8) == uVar1 >> 0xc)) {
this_00 = *(CBaseEntity **)(puVar3 + 4);
}
if (((byte)this_00[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(this_00);
}
local_28 = *(float *)(this_00 + 0x2e0) - *pfVar2;
local_24 = *(float *)(this_00 + 0x2e4) - pfVar2[1];
this_01 = (Vector *)&local_28;
local_20 = *(float *)(this_00 + 0x2e8) - pfVar2[2];
VectorNormalize(this_01);
if (this[0x524] == (CBreakableSurface)0x0) {
Die((CBreakableSurface *)this_01,in_stack_ffffffc8,in_stack_ffffffcc);
}
}
}
return 0;
}
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.