L L4D2node

CPoseController::SetProp

0x00495b00 · 559 bytes · __thiscall

_ZN15CPoseController7SetPropEP14CBaseAnimating

Decompiled

undefined (2 params)

/* CPoseController::SetProp(CBaseAnimating*) */

void __thiscall CPoseController::SetProp(CPoseController *this,CBaseAnimating *param_1)

{
  CBaseEdict *pCVar1;
  CPoseController CVar2;
  uint *puVar3;
  int iVar4;
  uint uVar5;
  CStudioHdr *pCVar6;
  CBaseAnimating *pCVar7;
  undefined *puVar8;
  CStudioHdr *pCVar9;
  CPoseController *__s1;
  char *pcVar10;
  uint local_20 [4];
  
  pCVar7 = (CBaseAnimating *)0x0;
  uVar5 = *(uint *)(this + 0x440);
  if (((uVar5 != 0xffffffff) &&
      (puVar8 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar8 + 8) == uVar5 >> 0xc)) {
    pCVar7 = *(CBaseAnimating **)(puVar8 + 4);
  }
  if (param_1 != pCVar7) {
    local_20[0] = 0xffffffff;
    if (param_1 != (CBaseAnimating *)0x0) {
      puVar3 = (uint *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
      local_20[0] = *puVar3;
    }
    iVar4 = memcmp(this + 0x440,local_20,4);
    if (iVar4 != 0) {
      if (this[0x6c] == (CPoseController)0x0) {
        pCVar1 = *(CBaseEdict **)(this + 0x30);
        if (pCVar1 != (CBaseEdict *)0x0) {
          *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
          iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
          *(undefined2 *)(iVar4 + 2) = 0;
        }
        *(uint *)(this + 0x440) = local_20[0];
      }
      else {
        this[0x70] = (CPoseController)((byte)this[0x70] | 1);
        *(uint *)(this + 0x440) = local_20[0];
      }
    }
  }
  pcVar10 = "";
  if (*(char **)(this + 0x45c) != (char *)0x0) {
    pcVar10 = *(char **)(this + 0x45c);
  }
  pCVar6 = *(CStudioHdr **)(param_1 + 0x13e0);
  if (pCVar6 == (CStudioHdr *)0x0) {
    iVar4 = CBaseEntity::GetModel((CBaseEntity *)param_1);
    if (iVar4 == 0) {
      pCVar6 = *(CStudioHdr **)(param_1 + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr(param_1);
      pCVar6 = *(CStudioHdr **)(param_1 + 0x13e0);
    }
    pCVar9 = (CStudioHdr *)0x0;
    if (pCVar6 == (CStudioHdr *)0x0) goto LAB_00495baa;
  }
  pCVar9 = (CStudioHdr *)0x0;
  if (*(int *)pCVar6 != 0) {
    pCVar9 = pCVar6;
  }
LAB_00495baa:
  uVar5 = CBaseAnimating::LookupPoseParameter(param_1,pCVar9,pcVar10);
  if (uVar5 == 0xffffffff) {
    uVar5 = 0x18;
  }
  if (((byte)this[0x450] != uVar5) && (CVar2 = SUB41(uVar5,0), this[0x450] != CVar2)) {
    if (this[0x6c] == (CPoseController)0x0) {
      pCVar1 = *(CBaseEdict **)(this + 0x30);
      if (pCVar1 != (CBaseEdict *)0x0) {
        *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
      this[0x450] = CVar2;
    }
    else {
      this[0x70] = (CPoseController)((byte)this[0x70] | 1);
      this[0x450] = CVar2;
    }
  }
  __s1 = this + 0x444;
  do {
    uVar5 = *(uint *)__s1;
    if (((uVar5 != 0xffffffff) &&
        (puVar8 = g_pEntityList + (uVar5 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
       ((*(uint *)(puVar8 + 8) == uVar5 >> 0xc && (*(int *)(puVar8 + 4) != 0)))) {
      local_20[0] = 0xffffffff;
      iVar4 = memcmp(__s1,local_20,4);
      if (iVar4 != 0) {
        if (this[0x6c] == (CPoseController)0x0) {
          pCVar1 = *(CBaseEdict **)(this + 0x30);
          if (pCVar1 != (CBaseEdict *)0x0) {
            *(uint *)pCVar1 = *(uint *)pCVar1 | 0x101;
            iVar4 = CBaseEdict::GetChangeAccessor(pCVar1);
            *(undefined2 *)(iVar4 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CPoseController)((byte)this[0x70] | 1);
        }
        *(uint *)__s1 = local_20[0];
      }
    }
    __s1 = __s1 + 4;
  } while (__s1 != this + 0x450);
  this[0x454] = (CPoseController)0x0;
  return;
}

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)