L L4D2node

CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>>::FindAndRemove

0x008302a0 · 243 bytes · __thiscall

_ZN10CUtlVectorI7CHandleI11CBaseEntityE10CUtlMemoryIS2_iEE13FindAndRemoveERKS2_

Decompiled

undefined (2 params)

/* CUtlVector<CHandle<CBaseEntity>, CUtlMemory<CHandle<CBaseEntity>, int>
   >::FindAndRemove(CHandle<CBaseEntity> const&) */

undefined4 __thiscall
CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>>::FindAndRemove
          (CUtlVector<CHandle<CBaseEntity>,CUtlMemory<CHandle<CBaseEntity>,int>> *this,
          CHandle *param_1)

{
  int *piVar1;
  uint uVar2;
  uint uVar3;
  int iVar4;
  undefined *puVar5;
  int iVar6;
  
  if (0 < *(int *)(this + 0xc)) {
    uVar2 = *(uint *)param_1;
    iVar4 = 0;
    piVar1 = (int *)(g_pEntityList + (uVar2 & 0xfff) * 0x10 + 4);
    do {
      iVar6 = 0;
      if (uVar2 != 0xffffffff) {
        if (piVar1 == (int *)0x0) {
          iVar6 = 0;
        }
        else if (piVar1[1] == uVar2 >> 0xc) {
          iVar6 = *piVar1;
        }
      }
      uVar3 = *(uint *)(*(int *)this + iVar4 * 4);
      if (((uVar3 == 0xffffffff) ||
          (puVar5 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar5 == (undefined *)0xfffffffc)) ||
         (*(uint *)(puVar5 + 8) != uVar3 >> 0xc)) {
        if (iVar6 == 0) goto LAB_00830360;
      }
      else if (iVar6 == *(int *)(puVar5 + 4)) {
LAB_00830360:
        ShiftElementsLeft(this,iVar4,1);
        *(int *)(this + 0xc) = *(int *)(this + 0xc) + -1;
        return 1;
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 != *(int *)(this + 0xc));
  }
  return 0;
}

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)