GetBreakableDamage
0x007e8c30 · 448 bytes · __cdecl
_Z18GetBreakableDamageRK15CTakeDamageInfoP22IBreakableWithPropData
Decompiled
undefined (2 params)
/* GetBreakableDamage(CTakeDamageInfo const&, IBreakableWithPropData*) */
longdouble GetBreakableDamage(CTakeDamageInfo *param_1,IBreakableWithPropData *param_2)
{
uint uVar1;
IBreakableWithPropData *pIVar2;
char cVar3;
longdouble lVar4;
float fVar5;
float fVar6;
uVar1 = *(uint *)(param_1 + 0x48);
fVar5 = *(float *)(param_1 + 0x3c);
if (((uVar1 & 2) == 0) || (*(int *)(DebugZombieBreakables._28_4_ + 0x30) != 0)) {
if ((uVar1 & 0x80) == 0) goto LAB_007e8d40;
if (param_2 != (IBreakableWithPropData *)0x0) goto LAB_007e8c6c;
LAB_007e8da0:
fVar5 = fVar5 * *(float *)(func_breakdmg_club._28_4_ + 0x2c);
if ((uVar1 & 0x40) == 0) goto LAB_007e8c93;
LAB_007e8db3:
fVar5 = fVar5 * *(float *)(func_breakdmg_explosive._28_4_ + 0x2c);
goto LAB_007e8cba;
}
if ((uVar1 & 0x20000000) == 0) {
if (param_2 == (IBreakableWithPropData *)0x0) {
fVar6 = *(float *)(func_breakdmg_bullet._28_4_ + 0x2c);
LAB_007e8d9a:
fVar5 = fVar5 * fVar6;
if ((uVar1 & 0x80) != 0) goto LAB_007e8da0;
goto LAB_007e8d40;
}
lVar4 = (longdouble)(**(code **)(*(int *)param_2 + 0x10))(param_2);
fVar5 = fVar5 * (float)lVar4;
}
else {
if (param_2 == (IBreakableWithPropData *)0x0) {
fVar6 = *(float *)(func_breakdmg_bullet._28_4_ + 0x2c) +
*(float *)(func_breakdmg_bullet._28_4_ + 0x2c);
goto LAB_007e8d9a;
}
lVar4 = (longdouble)(**(code **)(*(int *)param_2 + 0x10))(param_2);
fVar5 = (fVar5 + fVar5) * (float)lVar4;
}
if ((uVar1 & 0x80) == 0) {
LAB_007e8d40:
if ((uVar1 & 0x40) != 0) {
if (param_2 == (IBreakableWithPropData *)0x0) goto LAB_007e8db3;
goto LAB_007e8d4d;
}
LAB_007e8c93:
pIVar2 = param_2;
if ((uVar1 & 8) == 0) goto LAB_007e8cba;
}
else {
LAB_007e8c6c:
lVar4 = (longdouble)(**(code **)(*(int *)param_2 + 0x14))(param_2);
fVar5 = fVar5 * (float)lVar4;
if ((uVar1 & 0x40) == 0) goto LAB_007e8c93;
LAB_007e8d4d:
lVar4 = (longdouble)(**(code **)(*(int *)param_2 + 0x18))(param_2);
fVar5 = fVar5 * (float)lVar4;
pIVar2 = (IBreakableWithPropData *)(uVar1 & 8);
}
if (pIVar2 != (IBreakableWithPropData *)0x0) {
lVar4 = (longdouble)(**(code **)(*(int *)param_2 + 0x1c))(param_2);
fVar5 = fVar5 * (float)lVar4;
}
LAB_007e8cba:
if ((uVar1 & 5) == 5) {
fVar5 = fVar5 * 10.0;
}
cVar3 = (**(code **)(*g_pGameRules + 0x44))(g_pGameRules,uVar1);
if (cVar3 != '\0') {
fVar5 = 0.0;
}
return (longdouble)fVar5;
}
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.