L L4D2node

LightDesc_t::RecalculateDerivedValues

0x00271040 · 245 bytes · __thiscall

_ZN11LightDesc_t24RecalculateDerivedValuesEv

Decompiled

undefined (1 param)

/* LightDesc_t::RecalculateDerivedValues() */

void __thiscall LightDesc_t::RecalculateDerivedValues(LightDesc_t *this)

{
  float fVar1;
  float fVar2;
  
  *(undefined4 *)(this + 0x50) = 8;
  if (*(float *)(this + 0x30) != 0.0) {
    *(undefined4 *)(this + 0x50) = 9;
  }
  if (*(float *)(this + 0x34) != 0.0) {
    *(uint *)(this + 0x50) = *(uint *)(this + 0x50) | 2;
  }
  if (*(float *)(this + 0x38) != 0.0) {
    *(uint *)(this + 0x50) = *(uint *)(this + 0x50) | 4;
  }
  if (*(int *)this == 3) {
    fVar1 = cosf(*(float *)(this + 0x3c));
    *(float *)(this + 0x44) = fVar1;
    fVar2 = cosf(*(float *)(this + 0x40));
    *(float *)(this + 0x48) = fVar2;
    if (fVar1 - fVar2 <= 1e-10) {
      *(undefined4 *)(this + 0x4c) = 0x3f800000;
    }
    else {
      *(float *)(this + 0x4c) = 1.0 / (fVar1 - fVar2);
    }
  }
  else if (*(int *)this == 2) {
    *(float *)(this + 0x14) = *(float *)(this + 0x20) * 2e+06;
    *(float *)(this + 0x18) = *(float *)(this + 0x24) * 2e+06;
    *(float *)(this + 0x10) = *(float *)(this + 0x1c) * 2e+06;
  }
  *(float *)(this + 0x54) = *(float *)(this + 0x28) * *(float *)(this + 0x28);
  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)