L L4D2node

CEntityList::AddEntity

0x0063e8b0 · 271 bytes · __thiscall

_ZN11CEntityList9AddEntityEP11CBaseEntity

Decompiled

undefined (2 params)

/* CEntityList::AddEntity(CBaseEntity*) */

void __thiscall CEntityList::AddEntity(CEntityList *this,CBaseEntity *param_1)

{
  uint uVar1;
  uint *puVar2;
  undefined4 *puVar3;
  undefined4 *puVar4;
  undefined *puVar5;
  uint *puVar6;
  
  puVar2 = *(uint **)(this + 4);
  if (*(uint **)(this + 4) == (uint *)0x0) {
    puVar3 = (undefined4 *)CUtlMemoryPool::Alloc((CUtlMemoryPool *)g_EntListMemPool,8);
    *puVar3 = 0xffffffff;
    *(undefined4 **)(this + 4) = puVar3;
    if (param_1 == (CBaseEntity *)0x0) {
      *puVar3 = 0xffffffff;
    }
    else {
      puVar4 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
      *puVar3 = *puVar4;
    }
    *(undefined4 *)(*(int *)(this + 4) + 4) = 0;
    *(undefined4 *)this = 1;
    return;
  }
  do {
    puVar6 = puVar2;
    uVar1 = *puVar6;
    if (((uVar1 == 0xffffffff) ||
        (puVar5 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
       (*(uint *)(puVar5 + 8) != uVar1 >> 0xc)) {
      if (param_1 == (CBaseEntity *)0x0) {
        return;
      }
    }
    else if (param_1 == *(CBaseEntity **)(puVar5 + 4)) {
      return;
    }
    puVar2 = (uint *)puVar6[1];
  } while ((uint *)puVar6[1] != (uint *)0x0);
  puVar3 = (undefined4 *)CUtlMemoryPool::Alloc((CUtlMemoryPool *)g_EntListMemPool,8);
  *puVar3 = 0xffffffff;
  puVar6[1] = (uint)puVar3;
  if (param_1 == (CBaseEntity *)0x0) {
    *puVar3 = 0xffffffff;
  }
  else {
    puVar4 = (undefined4 *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    *puVar3 = *puVar4;
  }
  *(undefined4 *)(puVar6[1] + 4) = 0;
  *(int *)this = *(int *)this + 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)