L L4D2node

CRagdoll2::Create

0x004a2320 · 629 bytes · __thiscall

_ZN9CRagdoll26CreateERK15ragdollparams_tP10C_Infected

Decompiled

undefined (3 params)

/* CRagdoll2::Create(ragdollparams_t const&, C_Infected*) */

void __thiscall CRagdoll2::Create(CRagdoll2 *this,ragdollparams_t *param_1,C_Infected *param_2)

{
  cache_ragdoll_t *pcVar1;
  vcollide_t *pvVar2;
  char cVar3;
  CSyncCreator *this_00;
  int *piVar4;
  cache_ragdoll_t *pcVar5;
  int iVar6;
  CRagdoll2 *pCVar7;
  int in_GS_OFFSET;
  char local_84 [100];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  pCVar7 = this + 8;
  for (iVar6 = 0x218; iVar6 != 0; iVar6 = iVar6 + -1) {
    *(undefined4 *)pCVar7 = 0;
    pCVar7 = pCVar7 + 4;
  }
  this[0xc] = *(CRagdoll2 *)(param_1 + 0x34);
  pvVar2 = *(vcollide_t **)(param_1 + 4);
  if ((pvVar2 != (vcollide_t *)0x0) && ((*(ushort *)pvVar2 & 0x7fff) < 0x19)) {
    pcVar5 = *(cache_ragdoll_t **)(pvVar2 + 0xc);
    if (pcVar5 == (cache_ragdoll_t *)0x0) {
      pcVar5 = (cache_ragdoll_t *)
               ParseRagdollIntoCache(*(CStudioHdr **)(param_1 + 8),pvVar2,*(int *)(param_1 + 0xc));
    }
    piVar4 = modelinfo;
    *(cache_ragdoll_t **)(this + 0x8ac) = pcVar5;
    iVar6 = (**(code **)(*piVar4 + 0x1c))(piVar4,*(undefined4 *)(param_1 + 0xc));
    *(int *)(this + 0x8a4) = iVar6;
    if (iVar6 != 0) {
      if (*(int *)(g_cv_phys2_ragdoll_log._28_4_ + 0x30) != 0) {
        piVar4 = (int *)(**(code **)(*g_pPhysics2 + 0x24))(g_pPhysics2,1);
        s_pRecorder = (int *)(**(code **)(*piVar4 + 0x40))(piVar4,0,0);
      }
      AdjustScale((ragdollparams_t *)this);
      if ((*(short **)(this + 0x8a4) != (short *)0x0) && (**(short **)(this + 0x8a4) != 0)) {
        this_00 = ::operator_new(0x54);
        CSyncCreator::CSyncCreator(this_00,this,pcVar5,param_1,param_2);
        pcVar1 = pcVar5 + 0x20;
        *(CSyncCreator **)(this + 0x8b8) = this_00;
        PrepareAddSolids(this,param_1,pcVar1,(int)*(short *)(pcVar5 + 0x18),
                         pcVar1 + *(short *)(pcVar5 + 0x18) * 0x38,(int)*(short *)(pcVar5 + 0x1a),
                         pcVar1 + *(short *)(pcVar5 + 0x18) * 0x38 + *(short *)(pcVar5 + 0x1a) * 100
                         ,*(undefined4 *)(this_00 + 0x2c),*(undefined4 *)(this_00 + 0x30));
        (**(code **)(*g_pPhys2World + 200))(g_pPhys2World,*(undefined4 *)(this + 0x8b8));
        if (s_pRecorder != (int *)0x0) {
          V_snprintf(local_84,100,"d:/ragdoll/%03d.xml",s_globalCount);
          cVar3 = (**(code **)(*s_pRecorder + 0x10))(s_pRecorder,local_84);
          if (cVar3 == '\0') {
            Warning("Cannot save file %s\n",local_84);
          }
          piVar4 = (int *)(**(code **)(*g_pPhysics2 + 0x24))(g_pPhysics2,1);
          (**(code **)(*piVar4 + 0x48))(piVar4,s_pRecorder,0);
          s_pRecorder = (int *)0x0;
        }
      }
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)