L L4D2node

CRagdoll::VPhysicsUpdate

0x0049f530 · 442 bytes · __cdecl

_ZN8CRagdoll14VPhysicsUpdateEP14IPhysicsObject

Decompiled

undefined (1 param)

/* CRagdoll::VPhysicsUpdate(IPhysicsObject*) */

undefined4 CRagdoll::VPhysicsUpdate(IPhysicsObject *param_1)

{
  ragdoll_t *prVar1;
  IPhysicsObject IVar2;
  IPhysicsObject IVar3;
  char cVar4;
  undefined4 uVar5;
  float *pfVar6;
  CBaseEntity *pCVar7;
  matrix3x4_t *pmVar8;
  int iVar9;
  float local_28;
  float local_24;
  float local_20;
  
  uVar5 = 0;
  if (*(float *)(param_1 + 0x888) != *(float *)(gpGlobals + 0xc)) {
    if (0 < *(int *)(param_1 + 4)) {
      iVar9 = 0;
      pmVar8 = (matrix3x4_t *)(param_1 + 0x34);
      do {
        iVar9 = iVar9 + 1;
        (**(code **)(**(int **)(pmVar8 + -0x18) + 200))(*(int **)(pmVar8 + -0x18),pmVar8);
        pmVar8 = pmVar8 + 0x54;
      } while (iVar9 < *(int *)(param_1 + 4));
    }
    prVar1 = (ragdoll_t *)(param_1 + 4);
    MatrixGetColumn((matrix3x4_t *)(param_1 + 0x34),3,(Vector *)(param_1 + 0x87c));
    *(undefined4 *)(param_1 + 0x888) = *(undefined4 *)(gpGlobals + 0xc);
    pfVar6 = (float *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    local_28 = *pfVar6;
    local_24 = pfVar6[1];
    local_20 = pfVar6[2];
    RagdollComputeApproximateBbox
              (prVar1,(Vector *)&local_28,(Vector *)(param_1 + 0x864),(Vector *)(param_1 + 0x870));
    IVar2 = param_1[0x88c];
    *(float *)(param_1 + 0x864) = *(float *)(param_1 + 0x864) - local_28;
    *(float *)(param_1 + 0x868) = *(float *)(param_1 + 0x868) - local_24;
    *(float *)(param_1 + 0x86c) = *(float *)(param_1 + 0x86c) - local_20;
    *(float *)(param_1 + 0x870) = *(float *)(param_1 + 0x870) - local_28;
    *(float *)(param_1 + 0x874) = *(float *)(param_1 + 0x874) - local_24;
    *(float *)(param_1 + 0x878) = *(float *)(param_1 + 0x878) - local_20;
    IVar3 = (IPhysicsObject)RagdollIsAsleep(prVar1);
    param_1[0x88c] = IVar3;
    if (IVar3 == (IPhysicsObject)0x0) {
      cVar4 = (**(code **)(**(int **)(param_1 + 0xc) + 0xc))(*(int **)(param_1 + 0xc));
      if (cVar4 != '\0') {
        pCVar7 = (CBaseEntity *)
                 (**(code **)(**(int **)(param_1 + 0x1c) + 0x48))(*(int **)(param_1 + 0x1c));
        RagdollSolveSeparation(prVar1,pCVar7);
      }
      if (IVar2 == (IPhysicsObject)0x0) {
        CheckSettleStationaryRagdoll((CRagdoll *)param_1);
      }
      else {
        (**(code **)(*(int *)param_1 + 0x34))(param_1);
      }
    }
    uVar5 = 1;
  }
  return uVar5;
}

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)