L L4D2node

CRagdollLRURetirement::AddFader

0x0051d7c0 · 376 bytes · __thiscall

_ZN21CRagdollLRURetirement8AddFaderEP17CFuncRagdollFader

Decompiled

undefined (2 params)

/* CRagdollLRURetirement::AddFader(CFuncRagdollFader*) */

void __thiscall
CRagdollLRURetirement::AddFader(CRagdollLRURetirement *this,CFuncRagdollFader *param_1)

{
  int iVar1;
  int iVar2;
  undefined4 *puVar3;
  int iVar4;
  void *pvVar5;
  int iVar6;
  undefined4 local_30;
  undefined4 local_20 [4];
  
  local_20[0] = 0xffffffff;
  if (param_1 == (CFuncRagdollFader *)0x0) {
    iVar4 = CUtlVector<CHandle<CFuncRagdollFader>,CUtlMemory<CHandle<CFuncRagdollFader>,int>>::Find
                      ((CUtlVector<CHandle<CFuncRagdollFader>,CUtlMemory<CHandle<CFuncRagdollFader>,int>>
                        *)(this + 0x98),(CHandle *)local_20);
    if (-1 < iVar4) {
      return;
    }
    local_30 = 0xffffffff;
  }
  else {
    puVar3 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    local_20[0] = *puVar3;
    iVar4 = CUtlVector<CHandle<CFuncRagdollFader>,CUtlMemory<CHandle<CFuncRagdollFader>,int>>::Find
                      ((CUtlVector<CHandle<CFuncRagdollFader>,CUtlMemory<CHandle<CFuncRagdollFader>,int>>
                        *)(this + 0x98),(CHandle *)local_20);
    if (-1 < iVar4) {
      return;
    }
    puVar3 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    local_30 = *puVar3;
  }
  iVar1 = *(int *)(this + 0xa4);
  iVar6 = *(int *)(this + 0x9c);
  iVar4 = iVar1 + 1;
  if (iVar6 < iVar4) {
    iVar2 = *(int *)(this + 0xa0);
    if (-1 < iVar2) {
      if (iVar2 == 0) {
        if (iVar6 == 0) {
          if (iVar4 < 9) {
            iVar6 = 8;
            goto LAB_0051d8af;
          }
          iVar6 = 8;
        }
        do {
          iVar6 = iVar6 * 2;
        } while (iVar6 < iVar4);
      }
      else {
        for (iVar6 = (iVar1 / iVar2 + 1) * iVar2; iVar6 < iVar4; iVar6 = (iVar6 + iVar4) / 2) {
        }
      }
LAB_0051d8af:
      *(int *)(this + 0x9c) = iVar6;
      if (*(void **)(this + 0x98) == (void *)0x0) {
        pvVar5 = malloc(iVar6 << 2);
        *(void **)(this + 0x98) = pvVar5;
      }
      else {
        pvVar5 = realloc(*(void **)(this + 0x98),iVar6 << 2);
        *(void **)(this + 0x98) = pvVar5;
        iVar4 = *(int *)(this + 0xa4) + 1;
      }
      goto LAB_0051d836;
    }
  }
  pvVar5 = *(void **)(this + 0x98);
LAB_0051d836:
  *(int *)(this + 0xa4) = iVar4;
  iVar6 = iVar1 * 4;
  iVar4 = (iVar4 - iVar1) + -1;
  *(void **)(this + 0xa8) = pvVar5;
  if (0 < iVar4) {
    _V_memmove((void *)((int)pvVar5 + iVar6 + 4),(void *)((int)pvVar5 + iVar6),iVar4 * 4);
    pvVar5 = *(void **)(this + 0x98);
  }
  if ((undefined4 *)(iVar6 + (int)pvVar5) == (undefined4 *)0x0) {
    return;
  }
  *(undefined4 *)(iVar6 + (int)pvVar5) = local_30;
  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)