L L4D2node

CEntityListSystem::FrameUpdatePostEntityThink

0x0067ea10 · 532 bytes · __thiscall

_ZN17CEntityListSystem26FrameUpdatePostEntityThinkEv

Decompiled

undefined (1 param)

/* CEntityListSystem::FrameUpdatePostEntityThink() */

void __thiscall CEntityListSystem::FrameUpdatePostEntityThink(CEntityListSystem *this)

{
  int *piVar1;
  char cVar2;
  CBaseEntity *pCVar3;
  char *pcVar4;
  CBasePlayer *pCVar5;
  CBaseEntity *pCVar6;
  uint uVar7;
  edict_t *peVar8;
  undefined **local_20 [4];
  
  CEntityTouchManager::FrameUpdatePostEntityThink((CEntityTouchManager *)g_TouchManager);
  if (this[0xc] == (CEntityListSystem)0x0) {
    return;
  }
  this[0xc] = (CEntityListSystem)0x0;
  GlobalEntity_EnableStateUpdates(false);
  if ((gEntList._65540_4_ == 0) || (*(CBaseEntity **)gEntList._65540_4_ == (CBaseEntity *)0x0)) {
    CGlobalEntityList::CleanupDeleteList();
    GlobalEntity_EnableStateUpdates(true);
    (**(code **)(*engine + 0x17c))(engine);
    local_20[0] = &PTR_ShouldCreateEntity_00c78618;
    CNodeEnt::m_nNodeCount = 0;
    pcVar4 = (char *)(**(code **)(*engine + 0x11c))(engine);
    MapEntity_ParseAllEntities(pcVar4,(IMapEntityFilter *)local_20,true);
    return;
  }
  uVar7 = 0xffffffff;
  pCVar6 = *(CBaseEntity **)gEntList._65540_4_;
  do {
    pCVar3 = (CBaseEntity *)CGlobalEntityList::NextEnt((CGlobalEntityList *)gEntList,pCVar6);
    cVar2 = (**(code **)(*(int *)pCVar6 + 0x16c))(pCVar6);
    if (cVar2 != '\0') {
      if (*(int *)(pCVar6 + 0x30) == 0) {
        uVar7 = 0;
      }
      else {
        uVar7 = *(int *)(pCVar6 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
      }
    }
    if (((byte)pCVar6[0x14c] & 0x10) == 0) {
      UTIL_Remove(pCVar6);
    }
    pCVar6 = pCVar3;
  } while (pCVar3 != (CBaseEntity *)0x0);
  CGlobalEntityList::CleanupDeleteList();
  GlobalEntity_EnableStateUpdates(true);
  (**(code **)(*engine + 0x17c))(engine);
  CNodeEnt::m_nNodeCount = 0;
  local_20[0] = &PTR_ShouldCreateEntity_00c78618;
  pcVar4 = (char *)(**(code **)(*engine + 0x11c))(engine);
  MapEntity_ParseAllEntities(pcVar4,(IMapEntityFilter *)local_20,true);
  if ((int)uVar7 < 0) {
    return;
  }
  if (((uVar7 < 0x800) && (*(int *)(gpGlobals + 0x58) != 0)) &&
     (peVar8 = (edict_t *)(uVar7 * 0x10 + *(int *)(gpGlobals + 0x58)), ((byte)*peVar8 & 2) == 0)) {
    ClientPutInServer(peVar8,"unnamed");
    ClientActive(peVar8,false);
LAB_0067eb68:
    piVar1 = *(int **)(peVar8 + 0xc);
    if (piVar1 != (int *)0x0) {
      pCVar5 = (CBasePlayer *)(**(code **)(*piVar1 + 0x18))(piVar1);
      goto LAB_0067eb77;
    }
  }
  else {
    ClientPutInServer((edict_t *)0x0,"unnamed");
    ClientActive((edict_t *)0x0,false);
    peVar8 = *(edict_t **)(gpGlobals + 0x58);
    if ((peVar8 != (edict_t *)0x0) && (((byte)*peVar8 & 2) == 0)) goto LAB_0067eb68;
  }
  pCVar5 = (CBasePlayer *)0x0;
LAB_0067eb77:
  SceneManager_ClientActive(pCVar5);
  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)