L L4D2node

ShouldRemoveThisRagdoll

0x0051ccb0 · 524 bytes · __cdecl

_Z23ShouldRemoveThisRagdollP14CBaseAnimating

Decompiled

undefined (1 param)

/* ShouldRemoveThisRagdoll(CBaseAnimating*) */

undefined1 ShouldRemoveThisRagdoll(CBaseAnimating *param_1)

{
  char cVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  undefined4 local_28;
  undefined4 local_24;
  float local_20;
  
  if (g_RagdollLVManager == '\0') {
    if (param_1 == (CBaseAnimating *)0x0) {
      Msg("ALERT: why is Ragdoll pointer null?");
      return 0;
    }
    piVar2 = (int *)UTIL_GetLocalPlayer();
    iVar3 = UTIL_FindClientInPVS(*(edict_t **)(param_1 + 0x30));
    if (iVar3 == 0) {
      if (*(int *)(g_debug_ragdoll_removal._28_4_ + 0x30) == 0) {
        return 1;
      }
      if (((byte)param_1[0x14d] & 8) == 0) {
        local_28 = *(undefined4 *)(param_1 + 0x2e0);
        local_24 = *(undefined4 *)(param_1 + 0x2e4);
        local_20 = *(float *)(param_1 + 0x2e8) + 64.0;
      }
      else {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
        local_28 = *(undefined4 *)(param_1 + 0x2e0);
        local_24 = *(undefined4 *)(param_1 + 0x2e4);
        local_20 = *(float *)(param_1 + 0x2e8) + 64.0;
        if ((*(uint *)(param_1 + 0x14c) & 0x800) != 0) {
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
        }
      }
      iVar4 = 0;
      iVar3 = 0xff;
    }
    else {
      cVar1 = (**(code **)(*piVar2 + 0x3c8))(piVar2,param_1);
      if (cVar1 != '\0') {
        return 0;
      }
      if (*(int *)(g_debug_ragdoll_removal._28_4_ + 0x30) == 0) {
        return 1;
      }
      if (((byte)param_1[0x14d] & 8) == 0) {
        local_28 = *(undefined4 *)(param_1 + 0x2e0);
        local_24 = *(undefined4 *)(param_1 + 0x2e4);
        local_20 = *(float *)(param_1 + 0x2e8) + 64.0;
      }
      else {
        CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
        local_28 = *(undefined4 *)(param_1 + 0x2e0);
        local_24 = *(undefined4 *)(param_1 + 0x2e4);
        local_20 = *(float *)(param_1 + 0x2e8) + 64.0;
        if ((*(uint *)(param_1 + 0x14c) & 0x800) != 0) {
          CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_1);
        }
      }
      iVar4 = 0xff;
      iVar3 = 0;
    }
    NDebugOverlay::Line((Vector *)(param_1 + 0x2e0),(Vector *)&local_28,0,iVar3,iVar4,true,5.0);
  }
  return 1;
}

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)