L L4D2node

LightDesc_t::SetupOldStyleAttenuation

0x00271770 · 242 bytes · __thiscall

_ZN11LightDesc_t24SetupOldStyleAttenuationEfff

Decompiled

undefined (4 params)

/* LightDesc_t::SetupOldStyleAttenuation(float, float, float) */

void __thiscall
LightDesc_t::SetupOldStyleAttenuation(LightDesc_t *this,float param_1,float param_2,float param_3)

{
  float fVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  
  if (param_1 < 0.001) {
    fVar4 = 0.0;
    param_1 = 0.0;
  }
  else {
    fVar4 = param_1 * 10000.0;
  }
  fVar3 = 0.0;
  fVar2 = fVar3;
  fVar1 = fVar3;
  if (0.001 <= param_2) {
    fVar2 = param_2;
    fVar1 = param_2 * 100.0;
  }
  if (((param_3 < 0.001) && (param_3 = fVar3, fVar2 < 0.001)) && (param_1 < 0.001)) {
    param_3 = 1.0;
  }
  *(float *)(this + 0x38) = param_1;
  *(float *)(this + 0x34) = fVar2;
  *(float *)(this + 0x30) = param_3;
  fVar4 = fVar1 + fVar4 + param_3;
  if (0.0 < fVar4) {
    *(float *)(this + 4) = *(float *)(this + 4) * fVar4;
    *(float *)(this + 8) = *(float *)(this + 8) * fVar4;
    *(float *)(this + 0xc) = fVar4 * *(float *)(this + 0xc);
  }
  return;
}

SourceMod gamedata

paste into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)