ReadDamageTable
0x0078a3e0 · 162 bytes · __cdecl
_Z15ReadDamageTableP13impactentry_tifb
Decompiled
undefined (4 params)
/* ReadDamageTable(impactentry_t*, int, float, bool) */
longdouble ReadDamageTable(impactentry_t *param_1,int param_2,float param_3,bool param_4)
{
int iVar1;
int iVar2;
impactentry_t *piVar3;
if (((param_1 != (impactentry_t *)0x0) && (0 < param_2)) && (*(float *)param_1 <= param_3)) {
iVar1 = 0;
do {
iVar2 = iVar1;
iVar1 = iVar2 + 1;
if (iVar1 == param_2) goto LAB_0078a41f;
} while (*(float *)(param_1 + iVar1 * 8) <= param_3);
if (0 < iVar1) {
LAB_0078a41f:
if (param_4) {
piVar3 = param_1 + iVar2 * 8;
Msg("Damage %.0f, energy %.0f\n",(double)*(float *)(piVar3 + 4),(double)SQRT(param_3));
}
else {
piVar3 = param_1 + iVar2 * 8;
}
return (longdouble)*(float *)(piVar3 + 4);
}
}
return (longdouble)0.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.