AssignRangeMultiplier
0x0058f5a0 · 410 bytes · __cdecl
_Z21AssignRangeMultiplierid
Decompiled
undefined (2 params)
/* AssignRangeMultiplier(int, double) */
longdouble AssignRangeMultiplier(int param_1,double param_2)
{
int iVar1;
float *pfVar2;
uint uVar3;
float fVar4;
double dVar5;
double dVar6;
float local_30;
float local_1c [5];
if (param_1 == 0x20) {
dVar6 = 4294967294.0;
uVar3 = 0xfffffffe;
}
else {
iVar1 = 1 << ((byte)param_1 & 0x1f);
uVar3 = iVar1 - 1;
dVar6 = (double)(iVar1 + 0x7fffffff) + 2147483648.0;
}
local_30 = (float)(dVar6 / param_2);
if (ABS((float)param_2) <= 0.001) {
local_30 = (float)(uVar3 & 0xffff) + (float)(uVar3 >> 0x10) * 65536.0;
}
dVar5 = (double)local_30 * param_2;
if ((uVar3 < (uint)((int)(dVar5 - (double)(-(ulonglong)(2147483648.0 <= dVar5) &
0x41e0000000000000)) ^
(int)-(ulonglong)(2147483648.0 <= dVar5) << 0x1f)) || (dVar6 < dVar5)) {
local_1c[0] = 0.99;
local_1c[1] = 0.9;
local_1c[2] = 0.8;
local_1c[3] = 0.7;
fVar4 = 0.9999;
pfVar2 = local_1c;
while ((dVar5 = (double)(fVar4 * (float)(dVar6 / param_2)) * param_2,
uVar3 < (uint)((int)(dVar5 - (double)(-(ulonglong)(2147483648.0 <= dVar5) &
0x41e0000000000000)) ^
(int)-(ulonglong)(2147483648.0 <= dVar5) << 0x1f) || (dVar6 < dVar5))) {
if (pfVar2 == local_1c + 4) {
return (longdouble)0.0;
}
fVar4 = *pfVar2;
pfVar2 = pfVar2 + 1;
}
}
return (longdouble)local_30;
}
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.