Studio_IKRuleWeight
0x00b861d0 · 168 bytes · __cdecl
_Z19Studio_IKRuleWeightR17ikcontextikrule_tf
Decompiled
undefined (2 params)
/* Studio_IKRuleWeight(ikcontextikrule_t&, float) */
longdouble Studio_IKRuleWeight(ikcontextikrule_t *param_1,float param_2)
{
float fVar1;
float fVar2;
float fVar3;
fVar2 = *(float *)(param_1 + 0x48);
fVar1 = *(float *)(param_1 + 0x3c);
if (fVar2 <= 1.0) {
LAB_00b861fe:
fVar3 = 0.0;
if (param_2 < fVar1) goto LAB_00b86206;
}
else if (param_2 < fVar1) {
param_2 = param_2 + 1.0;
goto LAB_00b861fe;
}
if (param_2 < *(float *)(param_1 + 0x40)) {
fVar2 = (param_2 - fVar1) / (*(float *)(param_1 + 0x40) - fVar1);
LAB_00b86226:
return (longdouble)(fVar2 * fVar2 * 3.0 - (fVar2 + fVar2) * fVar2 * fVar2);
}
fVar1 = *(float *)(param_1 + 0x44);
fVar3 = 1.0;
if (fVar1 <= param_2) {
if (param_2 < fVar2) {
fVar2 = (param_2 - fVar1) / (fVar1 - fVar2) + 1.0;
goto LAB_00b86226;
}
fVar3 = 0.0;
}
LAB_00b86206:
return (longdouble)fVar3;
}
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.