L L4D2node

CRagdollPropAttached::InitRagdollAttached

0x0079a300 · 1739 bytes · __thiscall

_ZN20CRagdollPropAttached19InitRagdollAttachedEP14IPhysicsObjectRK6VectoriP11matrix3x4_tS6_fiP14CBaseAnimatingiS4_iS4_

Decompiled

undefined (13 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CRagdollPropAttached::InitRagdollAttached(IPhysicsObject*, Vector const&, int, matrix3x4_t*,
   matrix3x4_t*, float, int, CBaseAnimating*, int, Vector const&, int, Vector const&) */

void __thiscall
CRagdollPropAttached::InitRagdollAttached
          (CRagdollPropAttached *this,IPhysicsObject *param_1,Vector *param_2,int param_3,
          matrix3x4_t *param_4,matrix3x4_t *param_5,float param_6,int param_7,
          CBaseAnimating *param_8,int param_9,Vector *param_10,int param_11,Vector *param_12)

{
  code *pcVar1;
  CBaseEdict *pCVar2;
  undefined4 uVar3;
  int iVar4;
  vcollide_t *pvVar5;
  int *piVar6;
  CRagdollPropAttached *pCVar7;
  float fVar8;
  int local_1d4;
  float local_1c4;
  Vector local_1c0 [12];
  Vector local_1b4 [12];
  undefined4 local_1a8;
  undefined4 local_1a4;
  undefined4 local_1a0;
  float local_19c;
  float local_198;
  float local_194;
  matrix3x4_t local_190 [48];
  matrix3x4_t local_160 [48];
  matrix3x4_t local_130 [48];
  matrix3x4_t local_100 [48];
  undefined4 local_d0;
  undefined4 local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined1 local_bc;
  matrix3x4_t local_b8 [48];
  matrix3x4_t local_88 [48];
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  undefined1 local_20;
  undefined1 local_1f;
  undefined1 local_1e;
  
  if (param_11 < 1) {
    local_1d4 = 0;
    goto LAB_0079a34e;
  }
  piVar6 = *(int **)(this + 0x13e0);
  if (piVar6 == (int *)0x0) {
    iVar4 = CBaseEntity::GetModel((CBaseEntity *)this);
    if (iVar4 == 0) {
      piVar6 = *(int **)(this + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)this);
      piVar6 = *(int **)(this + 0x13e0);
    }
    if (piVar6 != (int *)0x0) goto LAB_0079a32b;
LAB_0079a9c5:
    iVar4 = _DAT_00000000;
  }
  else {
LAB_0079a32b:
    iVar4 = *piVar6;
    if (*piVar6 == 0) goto LAB_0079a9c5;
  }
  local_1d4 = *(int *)(iVar4 + 0xac + param_11 * 0xd8 + *(int *)(iVar4 + 0xa0));
LAB_0079a34e:
  CRagdollProp::InitRagdoll
            ((CRagdollProp *)this,param_2,param_3,(Vector *)&vec3_origin,param_4,param_5,param_6,
             param_7,false,true);
  piVar6 = *(int **)(this + local_1d4 * 0x54 + 0x1410);
  (**(code **)(*piVar6 + 0xe8))(piVar6,local_1c0,param_12);
  local_1f = 1;
  local_cc = 0;
  local_c8 = 0;
  local_d0 = 0x3f800000;
  local_c4 = 0x3f800000;
  local_c0 = 0x3f800000;
  local_bc = 1;
  SetIdentityMatrix(local_b8);
  SetIdentityMatrix(local_88);
  local_58 = 0xffffffff;
  local_54 = 0xffffffff;
  local_50 = 0;
  local_4c = 0;
  local_48 = 0;
  local_44 = 0;
  local_40 = 0;
  local_3c = 0;
  local_38 = 0;
  local_34 = 0;
  local_30 = 0;
  local_2c = 0;
  local_28 = 0;
  local_24 = 0;
  local_20 = 0;
  local_1e = 0;
  (**(code **)(*(int *)param_1 + 0xe4))(param_1,local_1b4,param_10);
  if (((byte)param_8[0x14d] & 8) != 0) {
    CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_8);
  }
  local_1a8 = 0;
  local_1a0 = 0;
  local_1a4 = *(undefined4 *)(param_8 + 0x380);
  AngleMatrix((QAngle *)&local_1a8,local_1b4,local_100);
  local_50 = 0xc0000000;
  local_4c = 0x40000000;
  local_48 = 0;
  local_44 = 0x41a00000;
  local_40 = 0;
  local_3c = 0;
  local_38 = 0;
  local_34 = 0;
  local_30 = 0xc1700000;
  local_2c = 0x41700000;
  local_28 = 0;
  local_24 = 0x41a00000;
  local_c0 = 0x42480000;
  (**(code **)(*(int *)param_1 + 200))(param_1,local_190);
  MatrixInvert(local_190,local_160);
  (**(code **)(*piVar6 + 200))(piVar6,local_190);
  MatrixInvert(local_190,local_130);
  ConcatTransforms(local_130,local_100,local_b8);
  ConcatTransforms(local_160,local_100,local_88);
  MatrixSetColumn(local_1c0,3,local_b8);
  PhysDisableEntityCollisions(param_1,*(IPhysicsObject **)(this + 0x1410));
  uVar3 = (**(code **)(*physenv + 0x40))
                    (physenv,piVar6,param_1,*(undefined4 *)(this + 0x1400),&local_d0);
  *(undefined4 *)(this + 0x2140) = uVar3;
  (**(code **)(*(int *)this + 0x98))(this,param_8,0xffffffff);
  (**(code **)(*(int *)this + 0x50))(this,param_8);
  iVar4 = (**(code **)(*(int *)this + 0x1c))(this);
  pcVar1 = *(code **)(*modelinfo + 0x18);
  uVar3 = (**(code **)(*(int *)this + 0x1c))(this);
  pvVar5 = (vcollide_t *)(*pcVar1)(modelinfo,uVar3);
  RagdollActivate((ragdoll_t *)(this + 0x13f8),pvVar5,iVar4,(CCallQueue *)0x0,true);
  if (0 < *(int *)(this + 0x13f8)) {
    iVar4 = 0;
    pCVar7 = this + 0x1410;
    do {
      iVar4 = iVar4 + 1;
      (**(code **)(**(int **)pCVar7 + 0x90))(*(int **)pCVar7,&local_1c4,&local_19c);
      local_1c4 = local_1c4 * 50.0;
      local_19c = local_19c * 50.0;
      (**(code **)(**(int **)pCVar7 + 0x8c))(*(int **)pCVar7,&local_1c4,&local_19c);
      pCVar7 = pCVar7 + 0x54;
    } while (iVar4 < *(int *)(this + 0x13f8));
  }
  if (param_9 != *(int *)(this + 0x211c)) {
    if (this[0x6c] == (CRagdollPropAttached)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CRagdollPropAttached)((byte)this[0x70] | 1);
    }
    *(int *)(this + 0x211c) = param_9;
  }
  if (local_1d4 != *(int *)(this + 0x2120)) {
    if (this[0x6c] == (CRagdollPropAttached)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar4 + 2) = 0;
      }
    }
    else {
      this[0x70] = (CRagdollPropAttached)((byte)this[0x70] | 1);
    }
    *(int *)(this + 0x2120) = local_1d4;
  }
  fVar8 = *(float *)param_10;
  if (((fVar8 != *(float *)(this + 0x2124)) ||
      (*(float *)(param_10 + 4) != *(float *)(this + 0x2128))) ||
     (*(float *)(param_10 + 8) != *(float *)(this + 0x212c))) {
    if (this[0x6c] == (CRagdollPropAttached)0x0) {
      pCVar2 = *(CBaseEdict **)(this + 0x30);
      if (pCVar2 != (CBaseEdict *)0x0) {
        *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
        iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
        *(undefined2 *)(iVar4 + 2) = 0;
        fVar8 = *(float *)param_10;
      }
    }
    else {
      this[0x70] = (CRagdollPropAttached)((byte)this[0x70] | 1);
      fVar8 = *(float *)param_10;
    }
    *(float *)(this + 0x2124) = fVar8;
    *(undefined4 *)(this + 0x2128) = *(undefined4 *)(param_10 + 4);
    *(undefined4 *)(this + 0x212c) = *(undefined4 *)(param_10 + 8);
  }
  MatrixGetColumn(local_b8,3,(Vector *)&local_19c);
  if (((local_19c == *(float *)(this + 0x2130)) && (local_198 == *(float *)(this + 0x2134))) &&
     (local_194 == *(float *)(this + 0x2138))) {
    return;
  }
  if (this[0x6c] == (CRagdollPropAttached)0x0) {
    pCVar2 = *(CBaseEdict **)(this + 0x30);
    if (pCVar2 != (CBaseEdict *)0x0) {
      *(uint *)pCVar2 = *(uint *)pCVar2 | 0x101;
      iVar4 = CBaseEdict::GetChangeAccessor(pCVar2);
      *(undefined2 *)(iVar4 + 2) = 0;
    }
  }
  else {
    this[0x70] = (CRagdollPropAttached)((byte)this[0x70] | 1);
  }
  *(float *)(this + 0x2130) = local_19c;
  *(float *)(this + 0x2134) = local_198;
  *(float *)(this + 0x2138) = local_194;
  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)