L L4D2node

UTIL_RemoveHierarchy

0x00836410 · 198 bytes · __cdecl

_Z20UTIL_RemoveHierarchyP11CBaseEntity

Decompiled

undefined (1 param)

/* UTIL_RemoveHierarchy(CBaseEntity*) */

void UTIL_RemoveHierarchy(CBaseEntity *param_1)

{
  uint uVar1;
  CBaseEntity *pCVar2;
  CBaseEntity *pCVar3;
  undefined *puVar4;
  
  if (param_1 == (CBaseEntity *)0x0) {
    return;
  }
  if ((((*(int *)(param_1 + 0x30) != 0) && (uVar1 = *(uint *)(param_1 + 0x18c), uVar1 != 0xffffffff)
       ) && (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar4 + 8) == uVar1 >> 0xc)) {
    pCVar3 = *(CBaseEntity **)(puVar4 + 4);
    while (pCVar3 != (CBaseEntity *)0x0) {
      uVar1 = *(uint *)(pCVar3 + 400);
      if (((uVar1 == 0xffffffff) ||
          (puVar4 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar4 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar4 + 8) != uVar1 >> 0xc)) {
        UTIL_RemoveHierarchy(pCVar3);
        UTIL_Remove(param_1);
        return;
      }
      pCVar2 = *(CBaseEntity **)(puVar4 + 4);
      UTIL_RemoveHierarchy(pCVar3);
      pCVar3 = pCVar2;
    }
  }
  UTIL_Remove(param_1);
  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)