L L4D2node

CGlobalEntityList::Clear

0x0067dc80 · 300 bytes · __thiscall

_ZN17CGlobalEntityList5ClearEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CGlobalEntityList::Clear() */

void __thiscall CGlobalEntityList::Clear(CGlobalEntityList *this)

{
  undefined4 *puVar1;
  int *piVar2;
  uint uVar3;
  IServerNetworkable *pIVar4;
  undefined4 *puVar5;
  int iVar6;
  uint uVar7;
  
  this[0x10020] = (CGlobalEntityList)0x1;
  if (*(int *)(this + 0x10004) != 0) {
    iVar6 = *(int *)(this + 0x10004) - (int)(this + 4);
    while( true ) {
      uVar7 = iVar6 >> 4;
      uVar3 = *(int *)(this + uVar7 * 0x10 + 8) << 0xc | uVar7;
      if (uVar3 == 0xffffffff) break;
      uVar7 = uVar7 & 0xfff;
      if (((*(uint *)(this + uVar7 * 0x10 + 8) == uVar3 >> 0xc) &&
          (piVar2 = *(int **)(this + uVar7 * 0x10 + 4), piVar2 != (int *)0x0)) &&
         (pIVar4 = (IServerNetworkable *)(**(code **)(*piVar2 + 0x14))(piVar2), piVar2 = mdlcache,
         pIVar4 != (IServerNetworkable *)0x0)) {
        (**(code **)(*mdlcache + 0x68))(mdlcache);
                    /* try { // try from 0067dd15 to 0067dd19 has its CatchHandler @ 0067ddb1 */
        UTIL_Remove(pIVar4);
        (**(code **)(*piVar2 + 0x6c))(piVar2);
        iVar6 = *(int *)(this + uVar7 * 0x10 + 0x10);
      }
      else {
        iVar6 = *(int *)(this + uVar7 * 0x10 + 0x10);
      }
      if (iVar6 == 0) break;
      iVar6 = iVar6 - (int)(this + 4);
    }
  }
  CleanupDeleteList();
  DAT_00fdb2e8 = 0;
  CUtlMemory<IServerNetworkable*,int>::Purge((CUtlMemory<IServerNetworkable*,int> *)&g_DeleteList);
  _DAT_00fdb2ec = g_DeleteList;
  if (0 < DAT_00fc910c) {
    puVar5 = (undefined4 *)(g_EntsByClassname + 0xc);
    puVar1 = puVar5 + DAT_00fc910c * 5;
    do {
      *puVar5 = 0;
      puVar5 = puVar5 + 5;
    } while (puVar5 != puVar1);
  }
  *(undefined4 *)(this + 0x10014) = 0;
  *(undefined4 *)(this + 0x10018) = 0;
  this[0x10020] = (CGlobalEntityList)0x0;
  CBaseEntity::m_nDebugPlayer = 0xffffffff;
  CBaseEntity::m_bInDebugSelect = 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)