L L4D2node

CRagdoll2::ApplyAnimationVelocity

0x004a1c30 · 411 bytes · __thiscall

_ZN9CRagdoll222ApplyAnimationVelocityEPK11matrix3x4_tS2_f

Decompiled

undefined (4 params)

/* CRagdoll2::ApplyAnimationVelocity(matrix3x4_t const*, matrix3x4_t const*, float) */

void __thiscall
CRagdoll2::ApplyAnimationVelocity
          (CRagdoll2 *this,matrix3x4_t *param_1,matrix3x4_t *param_2,float param_3)

{
  undefined4 uVar1;
  undefined4 uVar2;
  undefined4 uVar3;
  int iVar4;
  undefined4 *puVar5;
  int iVar6;
  undefined4 local_48;
  undefined4 local_44;
  undefined4 local_40;
  float local_3c;
  float local_38;
  float local_34;
  int local_30;
  undefined4 local_2c;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  if (*(int *)(phys2_ragdoll_velocity._28_4_ + 0x30) == 0) {
    return;
  }
  local_30 = 0;
  local_2c = 0;
  local_28 = 0;
  local_24 = 0;
  local_20 = 0;
                    /* try { // try from 004a1c80 to 004a1dd2 has its CatchHandler @ 004a1dd5 */
  CUtlVector<CRagdoll2::AddVel_t,CUtlMemory<CRagdoll2::AddVel_t,int>>::EnsureCount
            ((CUtlVector<CRagdoll2::AddVel_t,CUtlMemory<CRagdoll2::AddVel_t,int>> *)&local_30,
             *(int *)(this + 8));
  iVar4 = 0;
  if (0 < *(int *)(this + 8)) {
    do {
      while ((*(uint *)(this + 0x868) & 1 << ((byte)iVar4 & 0x1f)) == 0) {
        iVar4 = iVar4 + 1;
        if (*(int *)(this + 8) <= iVar4) goto LAB_004a1d59;
      }
      CalcBoneDerivatives((Vector *)&local_48,(Vector *)&local_3c,
                          param_1 + *(int *)(this + iVar4 * 4 + 0x7f4) * 0x30,
                          param_2 + *(int *)(this + iVar4 * 4 + 0x7f4) * 0x30,param_3);
      iVar6 = iVar4 + 1;
      puVar5 = (undefined4 *)(local_30 + iVar4 * 0x18);
      *puVar5 = local_48;
      iVar4 = iVar4 * 0x18 + local_30;
      puVar5[1] = local_44;
      puVar5[2] = local_40;
      *(float *)(iVar4 + 0x10) = local_38 * 0.017453292;
      *(float *)(iVar4 + 0x14) = local_34 * 0.017453292;
      *(float *)(iVar4 + 0xc) = local_3c * 0.017453292;
      iVar4 = iVar6;
    } while (iVar6 < *(int *)(this + 8));
  }
LAB_004a1d59:
  iVar4 = *(int *)(this + 0x8b8);
  if (iVar4 == 0) {
    ApplyAnimationVelocity(this,(CUtlVector *)&local_30);
  }
  else {
    uVar1 = *(undefined4 *)(iVar4 + 0x20);
    iVar6 = *(int *)(iVar4 + 0x18);
    *(undefined4 *)(iVar4 + 0x20) = local_28;
    uVar2 = *(undefined4 *)(iVar4 + 0x1c);
    *(int *)(iVar4 + 0x18) = local_30;
    *(undefined4 *)(iVar4 + 0x1c) = local_2c;
    *(undefined4 *)(iVar4 + 0x24) = local_24;
    uVar3 = *(undefined4 *)(iVar4 + 0x28);
    *(int *)(iVar4 + 0x28) = local_20;
    local_30 = iVar6;
    local_2c = uVar2;
    local_28 = uVar1;
    local_20 = uVar3;
  }
  local_24 = 0;
  CUtlMemory<CRagdoll2::AddVel_t,int>::Purge((CUtlMemory<CRagdoll2::AddVel_t,int> *)&local_30);
  local_20 = local_30;
  CUtlMemory<CRagdoll2::AddVel_t,int>::Purge((CUtlMemory<CRagdoll2::AddVel_t,int> *)&local_30);
  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)