L L4D2node

CBeamSpotlight::KeyValue

0x0062ef50 · 338 bytes · __thiscall

_ZN14CBeamSpotlight8KeyValueEPKcS1_

Decompiled

undefined (3 params)

/* CBeamSpotlight::KeyValue(char const*, char const*) */

undefined4 __thiscall CBeamSpotlight::KeyValue(CBeamSpotlight *this,char *param_1,char *param_2)

{
  float fVar1;
  float fVar2;
  CBaseEdict *pCVar3;
  int iVar4;
  undefined1 *puVar5;
  undefined4 uVar6;
  longdouble lVar7;
  
  iVar4 = _V_stricmp(param_1,"SpotlightWidth");
  if (iVar4 != 0) {
    uVar6 = CBaseEntity::KeyValue((CBaseEntity *)this,param_1,param_2);
    return uVar6;
  }
  lVar7 = (longdouble)V_atof(param_2);
  fVar1 = *(float *)(this + 0x44c);
  fVar2 = (float)lVar7;
  if (fVar2 != fVar1) {
    if (this[0x6c] == (CBeamSpotlight)0x0) {
      pCVar3 = *(CBaseEdict **)(this + 0x30);
      if (pCVar3 != (CBaseEdict *)0x0) {
        *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar3);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CBeamSpotlight)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x44c) = fVar2;
    fVar1 = fVar2;
  }
  if (102.3 < fVar1) {
    puVar5 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x154) != (undefined1 *)0x0) {
      puVar5 = *(undefined1 **)(this + 0x154);
    }
    Warning("Map Bug:  %s has SpotLightWidth %f > %f, clamping value\n",puVar5,(double)fVar1,
            0x4059933340000000);
    fVar1 = *(float *)(this + 0x44c);
    fVar2 = 102.3;
    if (fVar1 <= 102.3) {
      fVar2 = fVar1;
    }
    if (fVar1 != fVar2) {
      if (this[0x6c] == (CBeamSpotlight)0x0) {
        pCVar3 = *(CBaseEdict **)(this + 0x30);
        if (pCVar3 != (CBaseEdict *)0x0) {
          *(uint *)pCVar3 = *(uint *)pCVar3 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar3);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CBeamSpotlight)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x44c) = fVar2;
    }
  }
  return 1;
}

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)