L L4D2node

CGlobalEntityList::FindEntityByTarget

0x0067c830 · 138 bytes · __thiscall

_ZN17CGlobalEntityList18FindEntityByTargetEP11CBaseEntityPKc

Decompiled

undefined (3 params)

/* CGlobalEntityList::FindEntityByTarget(CBaseEntity*, char const*) */

int __thiscall
CGlobalEntityList::FindEntityByTarget(CGlobalEntityList *this,CBaseEntity *param_1,char *param_2)

{
  int *piVar1;
  int iVar2;
  char *pcVar3;
  uint *puVar4;
  int iVar5;
  
  if (param_1 == (CBaseEntity *)0x0) {
    piVar1 = *(int **)(this + 0x10004);
  }
  else {
    puVar4 = (uint *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
    piVar1 = *(int **)(this + (*puVar4 & 0xfff) * 0x10 + 0x10);
  }
  do {
    if (piVar1 == (int *)0x0) {
      return 0;
    }
    iVar2 = *piVar1;
    if (iVar2 == 0) {
      DevWarning("NULL entity in global entity list!\n");
    }
    else {
      pcVar3 = *(char **)(iVar2 + 0xf8);
      if ((pcVar3 != (char *)0x0) &&
         ((param_2 == pcVar3 || (iVar5 = _V_stricmp(pcVar3,param_2), iVar5 == 0)))) {
        return iVar2;
      }
    }
    piVar1 = (int *)piVar1[3];
  } while( true );
}

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)