LightDesc_t::DistanceAtWhichBrightnessIsLessThan
0x002711f0 · 211 bytes · __thiscall
_ZNK11LightDesc_t35DistanceAtWhichBrightnessIsLessThanEf
Decompiled
undefined (2 params)
/* LightDesc_t::DistanceAtWhichBrightnessIsLessThan(float) const */
longdouble __thiscall
LightDesc_t::DistanceAtWhichBrightnessIsLessThan(LightDesc_t *this,float param_1)
{
char cVar1;
float fVar2;
float fVar3;
float local_14;
float local_10 [3];
fVar2 = SQRT(*(float *)(this + 0xc) * *(float *)(this + 0xc) +
*(float *)(this + 4) * *(float *)(this + 4) +
*(float *)(this + 8) * *(float *)(this + 8));
fVar3 = 0.0;
if (0.0 < fVar2) {
fVar2 = param_1 / fVar2;
cVar1 = SolveQuadratic(fVar2 * *(float *)(this + 0x38),*(float *)(this + 0x34) * fVar2,
fVar2 * *(float *)(this + 0x30) - 1.0,&local_14,local_10);
fVar3 = 0.0;
if (cVar1 != '\0') {
fVar2 = local_14;
if (local_14 <= local_10[0]) {
fVar2 = local_10[0];
}
if ((0.0 <= fVar2) && (fVar3 = local_10[0], local_10[0] <= local_14)) {
fVar3 = local_14;
}
}
}
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.