L L4D2node

CDynamicLight::KeyValue

0x0066aa90 · 637 bytes · __thiscall

_ZN13CDynamicLight8KeyValueEPKcS1_

Decompiled

undefined (3 params)

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

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

{
  CBaseEdict *pCVar1;
  CDynamicLight CVar2;
  int iVar3;
  long lVar4;
  undefined4 uVar5;
  double dVar6;
  undefined4 local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  if ((param_1 == "_light") || (iVar3 = _V_stricmp(param_1,"_light"), iVar3 == 0)) {
    V_StringToColor32((color32_s *)&local_28,param_2);
    CVar2 = SUB41((uint)local_28 >> 0x10,0);
    if (local_28._0_1_ != this[0x124]) {
      if (this[0x6c] == (CDynamicLight)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CDynamicLight)((byte)this[0x70] | 1);
      }
      this[0x124] = local_28._0_1_;
    }
    if (local_28._1_1_ != this[0x125]) {
      if (this[0x6c] == (CDynamicLight)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CDynamicLight)((byte)this[0x70] | 1);
      }
      this[0x125] = local_28._1_1_;
    }
    if (CVar2 != this[0x126]) {
      if (this[0x6c] == (CDynamicLight)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CDynamicLight)((byte)this[0x70] | 1);
      }
      this[0x126] = CVar2;
    }
    return 1;
  }
  if ((param_1 != "pitch") && (iVar3 = _V_stricmp(param_1,"pitch"), iVar3 != 0)) {
    if ((param_1 != "spawnflags") && (iVar3 = _V_stricmp(param_1,"spawnflags"), iVar3 != 0)) {
      uVar5 = CBaseEntity::KeyValue((CBaseEntity *)this,param_1,param_2);
      return uVar5;
    }
    lVar4 = strtol(param_2,(char **)0x0,10);
    CVar2 = SUB41(lVar4,0);
    if (this[0x441] != CVar2) {
      if (this[0x6c] == (CDynamicLight)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar3 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar3 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CDynamicLight)((byte)this[0x70] | 1);
      }
      this[0x441] = CVar2;
    }
    this[0x440] = CVar2;
    return 1;
  }
  dVar6 = strtod(param_2,(char **)0x0);
  if ((float)dVar6 == 0.0) {
    return 1;
  }
  if (((byte)this[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
  }
  local_24 = *(undefined4 *)(this + 0x380);
  local_28 = -(float)dVar6;
  local_20 = *(undefined4 *)(this + 900);
  CBaseEntity::SetAbsAngles((CBaseEntity *)this,(QAngle *)&local_28);
  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)