L L4D2node

CRagdollLRURetirement::UpdateList

0x0051da20 · 1886 bytes · __thiscall

_ZN21CRagdollLRURetirement10UpdateListEibb

Decompiled

undefined (4 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CRagdollLRURetirement::UpdateList(int, bool, bool) */

void __thiscall
CRagdollLRURetirement::UpdateList(CRagdollLRURetirement *this,int param_1,bool param_2,bool param_3)

{
  CUtlLinkedList<CHandle<CBaseAnimating>,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CHandle<CBaseAnimating>,unsigned_short>,unsigned_short>>
  *this_00;
  ushort uVar1;
  ushort uVar2;
  int *piVar3;
  char cVar4;
  int iVar5;
  uint *puVar6;
  uint uVar7;
  CBaseAnimating *pCVar8;
  CBaseEntity *pCVar9;
  undefined *puVar10;
  int iVar11;
  uint uVar12;
  uint uVar13;
  char local_65;
  CUtlMemory<CBasePlayer*,int> *local_64;
  int local_5c;
  uint local_58;
  CBasePlayer *local_48;
  undefined4 local_44;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  int local_34;
  undefined4 local_30;
  undefined4 local_2c;
  undefined4 local_28;
  int local_24;
  undefined4 local_20;
  
  local_44 = 0;
  local_40 = 0;
  local_65 = param_2;
  if (___atan2f_finite == 0) {
    local_34 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_44,0,0,0,0,
               "/data/src/game/server/../../game/shared/terror/terrorragdollmanager.cpp",0xb5,
               &UpdateList(int,bool,bool)::tm_fmt,"(%s)%s","Unaccounted",
               "CRagdollLRURetirement::UpdateList");
    local_34 = ___atan2f_finite;
  }
  iVar11 = _DAT_0105db00;
  local_3c = local_44;
  local_38 = local_40;
                    /* try { // try from 0051dade to 0051dae2 has its CatchHandler @ 0051e22b */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar5 = ThreadGetCurrentId(), iVar11 == iVar5)) {
    if ((char *)*_DAT_0105d15c != "CRagdollLRURetirement::UpdateList") {
                    /* try { // try from 0051dea0 to 0051deb1 has its CatchHandler @ 0051e22b */
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc2d4ac,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  this_00 = (CUtlLinkedList<CHandle<CBaseAnimating>,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CHandle<CBaseAnimating>,unsigned_short>,unsigned_short>>
             *)(this + param_1 * 0x1c + 0xc);
  local_5c = *(int *)(this + 0xac);
  if (g_RagdollLVManager == '\0') {
    if (local_5c == -1) {
      if (param_3) {
        local_5c = *(int *)(g_ragdoll_maxcount._28_4_ + 0x30);
      }
      else {
        local_5c = *(int *)(*(int *)(*(int *)(g_RagdolMaxByType + param_1 * 4) + 0x1c) + 0x30);
      }
    }
  }
  else {
    local_5c = 0;
    local_65 = '\0';
  }
  if (local_5c < (int)(uint)*(ushort *)(this_00 + 0x12)) {
    uVar7 = (uint)*(ushort *)(this_00 + 0xc);
    if (*(ushort *)(this_00 + 0xc) == 0xffff) {
LAB_0051dee0:
      local_30 = 0;
      local_2c = 0;
      local_28 = 0;
      local_24 = 0;
      local_20 = 0;
                    /* try { // try from 0051df13 to 0051e004 has its CatchHandler @ 0051e1e6 */
      cVar4 = (**(code **)(*engine + 8))(engine);
      if (cVar4 == '\0') {
                    /* try { // try from 0051e186 to 0051e1b1 has its CatchHandler @ 0051e1e6 */
        local_48 = (CBasePlayer *)UTIL_GetListenServerHost();
        if (local_48 != (CBasePlayer *)0x0) {
          CUtlVector<CBasePlayer*,CUtlMemory<CBasePlayer*,int>>::InsertBefore
                    ((CUtlVector<CBasePlayer*,CUtlMemory<CBasePlayer*,int>> *)&local_30,local_24,
                     &local_48);
        }
      }
      else {
        local_48 = (CBasePlayer *)0x0;
      }
      local_64 = (CUtlMemory<CBasePlayer*,int> *)&local_30;
      if (((*(ushort *)(this_00 + 0xc) != 0xffff) &&
          (local_5c < (int)(uint)*(ushort *)(this_00 + 0x12))) &&
         (local_58 = (uint)*(ushort *)(this_00 + 0xc),
         *(int *)(this + 0xb8) < *(int *)(g_ragdoll_max_remove_per_frame._28_4_ + 0x30))) {
        do {
          iVar11 = 0;
          iVar5 = local_58 * 8;
          uVar13 = (uint)*(ushort *)(iVar5 + *(int *)this_00 + 6);
          uVar7 = *(uint *)(iVar5 + *(int *)this_00);
          if (((uVar7 != 0xffffffff) &&
              (puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)
              ) && (*(uint *)(puVar10 + 8) == uVar7 >> 0xc)) {
            iVar11 = *(int *)(puVar10 + 4);
          }
          piVar3 = *(int **)(iVar11 + 0x238);
          if ((local_65 == '\0') ||
             ((((uVar7 = *(uint *)(iVar11 + 0x224), uVar7 == 0xffffffff ||
                (puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10,
                puVar10 == (undefined *)0xfffffffc)) ||
               ((*(uint *)(puVar10 + 8) != uVar7 >> 0xc || (*(int *)(puVar10 + 4) == 0)))) &&
              ((piVar3 == (int *)0x0 ||
               (cVar4 = (**(code **)(*piVar3 + 0xc))(piVar3), cVar4 != '\0')))))) {
            puVar10 = g_pEntityList;
            *(int *)(this + 0xb4) = *(int *)(this + 0xb4) + -1;
            *(int *)(this + 0xb8) = *(int *)(this + 0xb8) + 1;
            uVar7 = *(uint *)(*(int *)this_00 + iVar5);
            pCVar9 = (CBaseEntity *)0x0;
            if ((uVar7 != 0xffffffff) &&
               ((puVar10 = puVar10 + (uVar7 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc &&
                (*(uint *)(puVar10 + 8) == uVar7 >> 0xc)))) {
              pCVar9 = *(CBaseEntity **)(puVar10 + 4);
            }
            CBaseEntity::SUB_StartFadeOut(pCVar9,0.0,true);
            CUtlLinkedList<CHandle<CBaseAnimating>,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CHandle<CBaseAnimating>,unsigned_short>,unsigned_short>>
            ::Unlink(this_00,(ushort)local_58);
            *(undefined2 *)(*(int *)this_00 + 6 + iVar5) = *(undefined2 *)(this_00 + 0x10);
            *(ushort *)(this_00 + 0x10) = (ushort)local_58;
          }
        } while (((uVar13 != 0xffff) && (local_5c < (int)(uint)*(ushort *)(this_00 + 0x12))) &&
                (local_58 = uVar13,
                *(int *)(this + 0xb8) < *(int *)(g_ragdoll_max_remove_per_frame._28_4_ + 0x30)));
      }
      local_24 = 0;
      CUtlMemory<CBasePlayer*,int>::Purge(local_64);
      local_20 = local_30;
      CUtlMemory<CBasePlayer*,int>::Purge(local_64);
      iVar11 = _DAT_0105db00;
      if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
         (iVar5 = ThreadGetCurrentId(), iVar11 == iVar5)) {
        cVar4 = CVProfNode::ExitScope();
        if (cVar4 != '\0') {
          _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
        }
        DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
      }
      if (local_34 == 0) {
        return;
      }
      (**(code **)(local_34 + 0x54))(local_34,local_3c,local_38,0,0,0);
      return;
    }
    do {
      puVar6 = (uint *)(*(int *)this_00 + uVar7 * 8);
      uVar12 = (uint)*(ushort *)((int)puVar6 + 6);
      uVar13 = *puVar6;
      if (((uVar13 == 0xffffffff) ||
          (puVar10 = g_pEntityList + (uVar13 & 0xfff) * 0x10, puVar10 == (undefined *)0xfffffffc))
         || ((*(uint *)(puVar10 + 8) != uVar13 >> 0xc || (*(int *)(puVar10 + 4) == 0)))) {
        CUtlLinkedList<CHandle<CBaseAnimating>,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CHandle<CBaseAnimating>,unsigned_short>,unsigned_short>>
        ::Unlink(this_00,(ushort)uVar7);
        *(undefined2 *)(*(int *)this_00 + 6 + uVar7 * 8) = *(undefined2 *)(this_00 + 0x10);
        *(ushort *)(this_00 + 0x10) = (ushort)uVar7;
        *(int *)(this + 0xb4) = *(int *)(this + 0xb4) + -1;
      }
      uVar7 = uVar12;
    } while (uVar12 != 0xffff);
    if (local_5c < (int)(uint)*(ushort *)(this_00 + 0x12)) {
      uVar1 = *(ushort *)(this_00 + 0xc);
      do {
        if (uVar1 == 0xffff) goto LAB_0051dee0;
        iVar5 = (uint)uVar1 * 8;
        uVar2 = *(ushort *)(iVar5 + *(int *)this_00 + 6);
        uVar7 = *(uint *)(iVar5 + *(int *)this_00);
        iVar11 = 0;
        if (((uVar7 != 0xffffffff) &&
            (puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc))
           && (*(uint *)(puVar10 + 8) == uVar7 >> 0xc)) {
          iVar11 = *(int *)(puVar10 + 4);
        }
        piVar3 = *(int **)(iVar11 + 0x238);
        if (piVar3 != (int *)0x0) {
          cVar4 = (**(code **)(*piVar3 + 0xc))(piVar3);
          if (cVar4 == '\0') {
            *(int *)(this + 0xb0) = *(int *)(this + 0xb0) + 1;
            uVar7 = *(uint *)(*(int *)this_00 + iVar5);
          }
          else {
            uVar7 = *(uint *)(*(int *)this_00 + iVar5);
          }
        }
        pCVar8 = (CBaseAnimating *)0x0;
        if (((uVar7 != 0xffffffff) &&
            (puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc))
           && (*(uint *)(puVar10 + 8) == uVar7 >> 0xc)) {
          pCVar8 = *(CBaseAnimating **)(puVar10 + 4);
        }
                    /* try { // try from 0051dce8 to 0051ddf7 has its CatchHandler @ 0051e227 */
        cVar4 = ShouldRemoveThisRagdoll(pCVar8);
        if (cVar4 != '\0') {
          *(int *)(this + 0xb4) = *(int *)(this + 0xb4) + -1;
          *(int *)(this + 0xb8) = *(int *)(this + 0xb8) + 1;
          uVar7 = *(uint *)(*(int *)this_00 + iVar5);
          pCVar9 = (CBaseEntity *)0x0;
          if (((uVar7 != 0xffffffff) &&
              (puVar10 = g_pEntityList + (uVar7 & 0xfff) * 0x10, puVar10 != (undefined *)0xfffffffc)
              ) && (*(uint *)(puVar10 + 8) == uVar7 >> 0xc)) {
            pCVar9 = *(CBaseEntity **)(puVar10 + 4);
          }
          CBaseEntity::SUB_StartFadeOut(pCVar9,0.0,true);
          CUtlLinkedList<CHandle<CBaseAnimating>,unsigned_short,false,unsigned_short,CUtlMemory<UtlLinkedListElem_t<CHandle<CBaseAnimating>,unsigned_short>,unsigned_short>>
          ::Unlink(this_00,uVar1);
          *(undefined2 *)(*(int *)this_00 + 6 + iVar5) = *(undefined2 *)(this_00 + 0x10);
          *(ushort *)(this_00 + 0x10) = uVar1;
        }
      } while ((local_5c < (int)(uint)*(ushort *)(this_00 + 0x12)) &&
              (uVar1 = uVar2,
              *(int *)(this + 0xb8) < *(int *)(g_ragdoll_max_remove_per_frame._28_4_ + 0x30)));
    }
  }
  iVar11 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar5 = ThreadGetCurrentId(), iVar11 == iVar5)) {
    cVar4 = CVProfNode::ExitScope();
    if (cVar4 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_34 != 0) {
    (**(code **)(local_34 + 0x54))(local_34,local_3c,local_38,0,0,0);
  }
  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)