L L4D2node

CRagdoll::CheckSettleStationaryRagdoll

0x0049f3f0 · 300 bytes · __thiscall

_ZN8CRagdoll28CheckSettleStationaryRagdollEv

Decompiled

undefined (1 param)

/* CRagdoll::CheckSettleStationaryRagdoll() */

void __thiscall CRagdoll::CheckSettleStationaryRagdoll(CRagdoll *this)

{
  float *pfVar1;
  undefined4 *puVar2;
  longdouble lVar3;
  float fVar4;
  
  lVar3 = (longdouble)(**(code **)(*physenv + 0x9c))(physenv);
  fVar4 = (float)lVar3 - *(float *)(this + 0x8a0);
  if (fVar4 <= 1.0) {
    fVar4 = 1.0;
  }
  if (10.0 <= fVar4) {
    fVar4 = 10.0;
  }
  pfVar1 = (float *)(**(code **)(*(int *)this + 0xc))(this);
  if (((ABS(*pfVar1 - *(float *)(this + 0x890)) <= fVar4) &&
      (ABS(pfVar1[1] - *(float *)(this + 0x894)) <= fVar4)) &&
     (ABS(pfVar1[2] - *(float *)(this + 0x898)) <= fVar4)) {
    lVar3 = (longdouble)(**(code **)(*physenv + 0x9c))(physenv);
    if ((float)lVar3 - *(float *)(this + 0x89c) < *(float *)(ragdoll_sleepaftertime._28_4_ + 0x2c))
    {
      return;
    }
    PhysForceRagdollToSleep(this);
    this[0x88c] = (CRagdoll)0x1;
    return;
  }
  lVar3 = (longdouble)(**(code **)(*physenv + 0x9c))(physenv);
  *(float *)(this + 0x89c) = (float)lVar3;
  puVar2 = (undefined4 *)(**(code **)(*(int *)this + 0xc))(this);
  *(undefined4 *)(this + 0x890) = *puVar2;
  *(undefined4 *)(this + 0x894) = puVar2[1];
  *(undefined4 *)(this + 0x898) = puVar2[2];
  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)