L L4D2node

CEnvLaser::KeyValue

0x00685530 · 664 bytes · __thiscall

_ZN9CEnvLaser8KeyValueEPKcS1_

Decompiled

undefined (3 params)

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

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

{
  CBaseEdict *pCVar1;
  int iVar2;
  long lVar3;
  undefined1 *puVar4;
  int iVar5;
  float fVar6;
  double dVar7;
  undefined1 *local_20 [4];
  
  if ((param_1 == "width") || (iVar2 = _V_stricmp(param_1,"width"), iVar2 == 0)) {
    dVar7 = strtod(param_2,(char **)0x0);
    fVar6 = (float)dVar7;
    if (102.3 <= fVar6) {
      fVar6 = 102.3;
    }
    if (fVar6 != *(float *)(this + 0x4b0)) {
      if (this[0x6c] == (CEnvLaser)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar2 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CEnvLaser)((byte)this[0x70] | 1);
      }
      *(float *)(this + 0x4b0) = fVar6;
    }
    return 1;
  }
  if ((param_1 == "NoiseAmplitude") || (iVar2 = _V_stricmp(param_1,"NoiseAmplitude"), iVar2 == 0)) {
    lVar3 = strtol(param_2,(char **)0x0,10);
    if ((float)lVar3 == *(float *)(this + 0x4c0)) {
      return 1;
    }
    if (this[0x6c] == (CEnvLaser)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar2 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CEnvLaser)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x4c0) = (float)lVar3;
    return 1;
  }
  if ((param_1 == "TextureScroll") || (iVar2 = _V_stricmp(param_1,"TextureScroll"), iVar2 == 0)) {
    lVar3 = strtol(param_2,(char **)0x0,10);
    if ((float)lVar3 == *(float *)(this + 0x4c8)) {
      return 1;
    }
    if (this[0x6c] == (CEnvLaser)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar2 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar2 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CEnvLaser)((byte)this[0x70] | 1);
    }
    *(float *)(this + 0x4c8) = (float)lVar3;
    return 1;
  }
  if ((param_1 != "texture") && (iVar2 = _V_stricmp(param_1,"texture"), iVar2 != 0)) {
    CBaseEntity::KeyValue((CBaseEntity *)this,param_1,param_2);
    return 1;
  }
  AllocPooledString((char *)local_20);
  *(undefined1 **)(this + 0x260) = local_20[0];
  CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
  puVar4 = &DAT_00d539c2;
  if (local_20[0] != (undefined1 *)0x0) {
    puVar4 = local_20[0];
  }
  iVar2 = (**(code **)(*soundemitterbase + 0x88))(soundemitterbase,puVar4);
  if (iVar2 == *(int *)(this + 0xf4)) {
    return 1;
  }
  if (this[0x6c] == (CEnvLaser)0x0) {
    pCVar1 = *(CBaseEdict **)(this + 0x30);
    if (pCVar1 != (CBaseEdict *)0x0) {
      *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
      iVar5 = CBaseEdict::GetChangeAccessor(pCVar1);
      *(undefined2 *)(iVar5 + 2) = 0;
    }
  }
  else {
    this[0x70] = (CEnvLaser)((byte)this[0x70] | 1);
  }
  *(int *)(this + 0xf4) = iVar2;
  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)