L L4D2node

CRagdoll2::FinishAddSolids

0x004a0da0 · 657 bytes · __thiscall

_ZN9CRagdoll215FinishAddSolidsEv

Decompiled

undefined (1 param)

/* CRagdoll2::FinishAddSolids() */

void __thiscall CRagdoll2::FinishAddSolids(CRagdoll2 *this)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int *piVar4;
  int iVar5;
  undefined4 uVar6;
  uint uVar7;
  int iVar8;
  int iVar9;
  int local_34;
  CRagdoll2 *local_30;
  Vector local_28 [24];
  
  iVar5 = *(int *)(this + 0x8b8);
  iVar1 = *(int *)(iVar5 + 0x38);
  iVar2 = *(int *)(iVar5 + 0x10);
  local_34 = *(short *)(iVar1 + 0x1a) * 100 + *(short *)(iVar1 + 0x18) * 0x38 + iVar1 + 0x20;
  iVar3 = *(int *)(g_cv_phys2_freeze_ragdolls._28_4_ + 0x30);
  if (iVar2 != 0) {
    iVar9 = 0;
    local_30 = this;
LAB_004a0e1c:
    do {
      if ((*(uint *)(this + 0x868) & 1 << ((byte)iVar9 & 0x1f)) != 0) {
        piVar4 = (int *)(**(code **)(*g_pPhys2World + 0x54))
                                  (g_pPhys2World,
                                   *(undefined4 *)(*(int *)(*(int *)(this + 0x8a4) + 8) + iVar9 * 4)
                                   ,iVar9 * 0x30 + *(int *)(iVar5 + 4),*(undefined4 *)(this + 0x8a8)
                                   ,0x15 - (uint)(iVar3 == 0),0,0);
        if (piVar4 != (int *)0x0) {
          iVar5 = *(int *)(local_34 + 4);
          (**(code **)(*piVar4 + 0x8c))(piVar4,(int)*(short *)(local_34 + 2));
          (**(code **)(*piVar4 + 0x58))(piVar4,8);
          (**(code **)(*piVar4 + 0xc))(piVar4,*(undefined4 *)(*(int *)(this + 0x8b8) + 0x50));
          (**(code **)(*piVar4 + 0x3c))
                    (piVar4,"ragdoll%d %s",s_globalCount,
                     *(undefined4 *)(*(int *)(*(int *)(this + 0x8a4) + 0x20) + iVar9 * 4));
          iVar8 = 0;
          if (-1 < iVar5) {
            iVar8 = iVar5;
          }
          (**(code **)(*piVar4 + 0x80))(piVar4,SQRT(*(float *)(iVar1 + 0x24 + iVar8 * 0x38)));
          iVar5 = (int)*(char *)(*(int *)(this + 0x8a4) + 0x40);
          if (iVar5 < 0) {
            iVar5 = 1;
          }
          (**(code **)(*piVar4 + 0x98))(piVar4,iVar5);
          if (s_pRecorder != (int *)0x0) {
            (**(code **)(*s_pRecorder + 8))(s_pRecorder,piVar4);
          }
          iVar9 = iVar9 + 1;
          *(int **)(local_30 + 0x24) = piVar4;
          uVar6 = (**(code **)(*piVar4 + 0x60))(piVar4);
          local_34 = local_34 + 8;
          *(undefined4 *)(local_30 + 0x20) = uVar6;
          iVar5 = *(int *)(this + 0x8b8);
          local_30 = local_30 + 0x54;
          if (iVar2 == iVar9) break;
          goto LAB_004a0e1c;
        }
        Warning("Ragdoll2: Cannot create body part %s\n",
                *(undefined4 *)(*(int *)(*(int *)(this + 0x8a4) + 0x20) + iVar9 * 4));
        iVar5 = *(int *)(this + 0x8b8);
      }
      local_30 = local_30 + 0x54;
      iVar9 = iVar9 + 1;
      local_34 = local_34 + 8;
    } while (iVar2 != iVar9);
    if (*(int *)(iVar5 + 0x10) != 0) {
      if (*(uint *)(iVar5 + 0x3c) < *(uint *)(this + 8)) {
        uVar7 = (uint)*(short *)(iVar1 + 0x54 + *(uint *)(iVar5 + 0x3c) * 0x38);
        if ((uVar7 < *(uint *)(this + 8)) &&
           (piVar4 = *(int **)(this + uVar7 * 0x54 + 0x20), piVar4 != (int *)0x0)) {
          (**(code **)(*piVar4 + 0xc4))(piVar4,local_28,0);
        }
        else {
          MatrixGetColumn(*(matrix3x4_t **)(iVar5 + 4),3,local_28);
        }
        AddHit(this,(Vector *)(*(int *)(this + 0x8b8) + 0x40),local_28);
      }
    }
  }
  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)