L L4D2node

CRagdollProp::Spawn

0x0079abf0 · 635 bytes · __thiscall

_ZN12CRagdollProp5SpawnEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CRagdollProp::Spawn() */

void __thiscall CRagdollProp::Spawn(CRagdollProp *this)

{
  code *pcVar1;
  CBaseEdict *pCVar2;
  undefined1 *puVar3;
  int iVar4;
  int *piVar5;
  CRagdollProp *pCVar6;
  longdouble lVar7;
  undefined1 *local_1820;
  matrix3x4_t local_181c [6156];
  
  lVar7 = (longdouble)CBaseEntity::GetGlobalFadeScale((CBaseEntity *)this);
  *(float *)(this + 0x1ed8) = (float)lVar7;
  (**(code **)(*(int *)this + 0x6c))(this);
  pcVar1 = *(code **)(*(int *)this + 0x70);
  (**(code **)(*(int *)this + 0x20))(&local_1820,this);
  puVar3 = &DAT_00d539c2;
  if (local_1820 != (undefined1 *)0x0) {
    puVar3 = local_1820;
  }
  (*pcVar1)(this,puVar3);
  piVar5 = *(int **)(this + 0x13e0);
  if (piVar5 == (int *)0x0) {
    iVar4 = CBaseEntity::GetModel((CBaseEntity *)this);
    if (iVar4 == 0) {
      piVar5 = *(int **)(this + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)this);
      piVar5 = *(int **)(this + 0x13e0);
    }
    if (piVar5 != (int *)0x0) goto LAB_0079ac64;
  }
  else {
LAB_0079ac64:
    iVar4 = *piVar5;
    if (*piVar5 != 0) goto LAB_0079ac6e;
  }
  iVar4 = _DAT_00000000;
LAB_0079ac6e:
  if ((*(byte *)(iVar4 + 0x99) & 8) == 0) {
    CBaseEntity::SetGlobalFadeScale((CBaseEntity *)this,*(float *)(this + 0x1ed8));
  }
  else {
    CBaseEntity::SetGlobalFadeScale((CBaseEntity *)this,0.0);
    *(undefined4 *)(this + 0x1ed8) = 0;
  }
  CBaseAnimating::SetupBones((CBaseAnimating *)this,local_181c,0x7ff00);
  CBaseEntity::SetAbsAngles((CBaseEntity *)this,(QAngle *)&vec3_angle);
  InitRagdoll(this,(Vector *)&vec3_origin,0,(Vector *)&vec3_origin,local_181c,local_181c,0.0,
              *(uint *)(this + 0x148) >> 2 & 1,true,(*(uint *)(this + 0x148) & 0x10000) == 0);
  *(undefined4 *)(this + 0x1ea8) = 0;
  if (*(float *)(this + 0x1ed0) != 0.0) {
    if (this[0x6c] == (CRagdollProp)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] = (CRagdollProp)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x1ed0) = 0;
  }
  if (*(int *)(this + 0x1ed4) != -1) {
    if (this[0x6c] == (CRagdollProp)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] = (CRagdollProp)((byte)this[0x70] | 1);
    }
    *(undefined4 *)(this + 0x1ed4) = 0xffffffff;
  }
  if ((*(uint *)(this + 0x148) & 0x2000) == 0) {
    *(uint *)(this + 0x14c) = *(uint *)(this + 0x14c) | 0x8000000;
  }
  if (((*(uint *)(this + 0x148) & 0x4000) != 0) && (0 < *(int *)(this + 0x13f8))) {
    pCVar6 = this + 0x1410;
    iVar4 = 0;
    do {
      piVar5 = *(int **)pCVar6;
      if (piVar5 != (int *)0x0) {
        (**(code **)(*piVar5 + 0x40))(piVar5,0);
      }
      iVar4 = iVar4 + 1;
      pCVar6 = pCVar6 + 0x54;
    } while (iVar4 < *(int *)(this + 0x13f8));
  }
  if (this[0x1c5c] != (CRagdollProp)0x0) {
    CBaseEntity::AddEffects((CBaseEntity *)this,0x20);
  }
  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)