CalculateExplosiveDamageForce
0x004c8590 · 265 bytes · __cdecl
_Z29CalculateExplosiveDamageForceP15CTakeDamageInfoRK6VectorS3_f
Decompiled
undefined (4 params)
/* CalculateExplosiveDamageForce(CTakeDamageInfo*, Vector const&, Vector const&, float) */
void CalculateExplosiveDamageForce
(CTakeDamageInfo *param_1,Vector *param_2,Vector *param_3,float param_4)
{
float fVar1;
longdouble lVar2;
float fVar3;
float local_18;
float local_14;
float local_10;
*(undefined4 *)(param_1 + 0xc) = *(undefined4 *)param_3;
*(undefined4 *)(param_1 + 0x10) = *(undefined4 *)(param_3 + 4);
*(undefined4 *)(param_1 + 0x14) = *(undefined4 *)(param_3 + 8);
fVar3 = *(float *)(param_1 + 0x44);
if (fVar3 == 3.4028235e+38) {
fVar3 = *(float *)(param_1 + 0x3c);
}
fVar3 = fVar3 * 300.0;
if (30000.0 <= fVar3) {
fVar3 = 30000.0;
}
lVar2 = (longdouble)(**(code **)(*random_valve + 4))(random_valve,0x3f59999a,0x3f933333);
local_18 = *(float *)param_2;
local_14 = *(float *)(param_2 + 4);
fVar3 = fVar3 * (float)lVar2;
local_10 = *(float *)(param_2 + 8);
VectorNormalize((Vector *)&local_18);
fVar1 = *(float *)(phys_pushscale._28_4_ + 0x2c);
*(float *)(param_1 + 4) = local_14 * fVar1 * param_4 * fVar3;
*(float *)(param_1 + 8) = local_10 * fVar1 * param_4 * fVar3;
*(float *)param_1 = fVar1 * local_18 * param_4 * fVar3;
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.