L L4D2node

CEnvShooter::KeyValue

0x0066d390 · 394 bytes · __thiscall

_ZN11CEnvShooter8KeyValueEPKcS1_

Decompiled

undefined (3 params)

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

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

{
  CBaseEdict *this_00;
  int iVar1;
  undefined4 uVar2;
  undefined1 *puVar3;
  int iVar4;
  long lVar5;
  undefined1 *local_20 [4];
  
  if ((param_1 == "shootmodel") || (iVar1 = _V_stricmp(param_1,"shootmodel"), iVar1 == 0)) {
    this[0x479] = (CEnvShooter)0x0;
    AllocPooledString((char *)local_20);
    *(undefined1 **)(this + 0x260) = local_20[0];
    CBaseEntity::DispatchUpdateTransmitState((CBaseEntity *)this);
    puVar3 = &DAT_00d539c2;
    if (local_20[0] != (undefined1 *)0x0) {
      puVar3 = local_20[0];
    }
    iVar1 = (**(code **)(*soundemitterbase + 0x88))(soundemitterbase,puVar3);
    if (iVar1 != *(int *)(this + 0xf4)) {
      if (this[0x6c] == (CEnvShooter)0x0) {
        this_00 = *(CBaseEdict **)(this + 0x30);
        if (this_00 != (CBaseEdict *)0x0) {
          *(uint *)this_00 = *(uint *)this_00 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(this_00);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
      }
      else {
        this[0x70] = (CEnvShooter)((byte)this[0x70] | 1);
      }
      *(int *)(this + 0xf4) = iVar1;
    }
    iVar1 = V_stristr(param_2,".vmt");
    if (iVar1 != 0) {
      this[0x479] = (CEnvShooter)0x1;
    }
  }
  else {
    if ((param_1 != "shootsounds") && (iVar1 = _V_stricmp(param_1,"shootsounds"), iVar1 != 0)) {
      uVar2 = CBaseEntity::KeyValue((CBaseEntity *)this,param_1,param_2);
      return uVar2;
    }
    lVar5 = strtol(param_2,(char **)0x0,10);
    switch(lVar5) {
    case 0:
      *(undefined4 *)(this + 0x448) = 0;
      break;
    case 1:
      *(undefined4 *)(this + 0x448) = 1;
      break;
    case 2:
      *(undefined4 *)(this + 0x448) = 2;
      break;
    case 3:
      *(undefined4 *)(this + 0x448) = 3;
      break;
    case 4:
      *(undefined4 *)(this + 0x448) = 8;
      break;
    default:
      *(undefined4 *)(this + 0x448) = 10;
    }
  }
  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)