L L4D2node

CGlobalEntityList::FindEntityByNameFast

0x0067c6b0 · 115 bytes · __thiscall

_ZN17CGlobalEntityList20FindEntityByNameFastEP11CBaseEntity8string_t

Decompiled

undefined (3 params)

/* CGlobalEntityList::FindEntityByNameFast(CBaseEntity*, string_t) */

int __thiscall
CGlobalEntityList::FindEntityByNameFast(CGlobalEntityList *this,int *param_1,char *param_3)

{
  int iVar1;
  uint *puVar2;
  int *piVar3;
  
  if ((param_3 != (char *)0x0) && (*param_3 != '\0')) {
    if (param_1 == (int *)0x0) {
      piVar3 = *(int **)(this + 0x10004);
    }
    else {
      puVar2 = (uint *)(**(code **)(*param_1 + 0xc))(param_1);
      piVar3 = *(int **)(this + (*puVar2 & 0xfff) * 0x10 + 0x10);
    }
    for (; piVar3 != (int *)0x0; piVar3 = (int *)piVar3[3]) {
      iVar1 = *piVar3;
      if (iVar1 == 0) {
        DevWarning("NULL entity in global entity list!\n");
      }
      else if ((*(char **)(iVar1 + 0x154) != (char *)0x0) && (param_3 == *(char **)(iVar1 + 0x154)))
      {
        return iVar1;
      }
    }
  }
  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)