L L4D2node

GlobalEntity_GetIndex

0x006d6ab0 · 109 bytes · __cdecl

_Z21GlobalEntity_GetIndexPKc

Decompiled

undefined (1 param)

/* GlobalEntity_GetIndex(char const*) */

int GlobalEntity_GetIndex(char *param_1)

{
  short *psVar1;
  int iVar2;
  int iVar3;
  short local_e [3];
  
  CUtlSymbolTable::Find((char *)local_e);
  if ((local_e[0] == -1) || (iVar2 = gGlobalState._84_4_ + -1, iVar2 < 0)) {
    iVar2 = -1;
  }
  else if (local_e[0] != *(short *)(gGlobalState._72_4_ + iVar2 * 0xc)) {
    iVar3 = gGlobalState._72_4_ + 0xc + iVar2 * 0xc;
    do {
      iVar2 = iVar2 + -1;
      if (iVar2 == -1) {
        return -1;
      }
      psVar1 = (short *)(iVar3 + -0x18);
      iVar3 = iVar3 + -0xc;
    } while (local_e[0] != *psVar1);
  }
  return iVar2;
}

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)