L L4D2node

CRopeKeyframe::KeyValue

0x008066d0 · 1108 bytes · __thiscall

_ZN13CRopeKeyframe8KeyValueEPKcS1_

Decompiled

undefined (3 params)

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

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

{
  CBaseEdict *pCVar1;
  int iVar2;
  long lVar3;
  undefined4 uVar4;
  uint uVar5;
  char *pcVar6;
  int in_GS_OFFSET;
  undefined4 local_230 [4];
  char local_220 [512];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  iVar2 = _V_stricmp(param_1,"Breakable");
  if (iVar2 == 0) {
    lVar3 = strtol(param_2,(char **)0x0,10);
    if ((lVar3 == 1) && (uVar5 = *(uint *)(this + 0x444) | 0x10, *(uint *)(this + 0x444) != uVar5))
    {
LAB_0080681b:
      if (this[0x6c] == (CRopeKeyframe)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] = (CRopeKeyframe)((byte)this[0x70] | 1);
      }
      *(uint *)(this + 0x444) = uVar5;
    }
  }
  else {
    iVar2 = _V_stricmp(param_1,"Collide");
    if (iVar2 == 0) {
      lVar3 = strtol(param_2,(char **)0x0,10);
      if ((lVar3 == 1) && (uVar5 = *(uint *)(this + 0x444) | 4, *(uint *)(this + 0x444) != uVar5))
      goto LAB_0080681b;
    }
    else {
      iVar2 = _V_stricmp(param_1,"Barbed");
      if (iVar2 == 0) {
        lVar3 = strtol(param_2,(char **)0x0,10);
        if ((lVar3 == 1) && (uVar5 = *(uint *)(this + 0x444) | 2, *(uint *)(this + 0x444) != uVar5))
        goto LAB_0080681b;
      }
      else {
        iVar2 = _V_stricmp(param_1,"UseWind");
        if (iVar2 == 0) {
          lVar3 = strtol(param_2,(char **)0x0,10);
          if ((lVar3 == 1) &&
             (uVar5 = *(uint *)(this + 0x444) | 0x20, *(uint *)(this + 0x444) != uVar5))
          goto LAB_0080681b;
        }
        else {
          iVar2 = _V_stricmp(param_1,"Dangling");
          if (iVar2 == 0) {
            lVar3 = strtol(param_2,(char **)0x0,10);
            uVar4 = 1;
            if ((lVar3 == 1) &&
               (uVar5 = *(uint *)(this + 0x474) & 0xfffffffd, *(uint *)(this + 0x474) != uVar5)) {
              if (this[0x6c] == (CRopeKeyframe)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] = (CRopeKeyframe)((byte)this[0x70] | 1);
              }
              *(uint *)(this + 0x474) = uVar5;
              uVar4 = 1;
            }
            goto LAB_00806735;
          }
          iVar2 = _V_stricmp(param_1,"Type");
          if (iVar2 == 0) {
            lVar3 = strtol(param_2,(char **)0x0,10);
            if (lVar3 == 0) {
              if (*(int *)(this + 0x458) != 10) {
                if (this[0x6c] == (CRopeKeyframe)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] = (CRopeKeyframe)((byte)this[0x70] | 1);
                }
                *(undefined4 *)(this + 0x458) = 10;
              }
            }
            else if (lVar3 == 1) {
              if (*(int *)(this + 0x458) != 4) {
                if (this[0x6c] == (CRopeKeyframe)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] = (CRopeKeyframe)((byte)this[0x70] | 1);
                }
                *(undefined4 *)(this + 0x458) = 4;
              }
            }
            else if (*(int *)(this + 0x458) != 2) {
              if (this[0x6c] == (CRopeKeyframe)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] = (CRopeKeyframe)((byte)this[0x70] | 1);
              }
              *(undefined4 *)(this + 0x458) = 2;
            }
          }
          else {
            iVar2 = _V_stricmp(param_1,"RopeShader");
            if (iVar2 == 0) {
              lVar3 = strtol(param_2,(char **)0x0,10);
              if (lVar3 == 0) {
                *(char **)(this + 0x460) = "cable/cable.vmt";
              }
              else {
                pcVar6 = "cable/rope.vmt";
                if (lVar3 != 1) {
                  pcVar6 = "cable/chain.vmt";
                }
                *(char **)(this + 0x460) = pcVar6;
              }
            }
            else {
              iVar2 = _V_stricmp(param_1,"RopeMaterial");
              if (iVar2 == 0) {
                iVar2 = V_stristr(param_2,".vmt");
                if (iVar2 == 0) {
                  V_snprintf(local_220,0x200,"%s.vmt",param_2);
                }
                AllocPooledString((char *)local_230);
                *(undefined4 *)(this + 0x460) = local_230[0];
              }
            }
          }
        }
      }
    }
  }
  uVar4 = CBaseEntity::KeyValue((CBaseEntity *)this,param_1,param_2);
LAB_00806735:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return uVar4;
}

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)