L L4D2node

VOX_LookupEntIndex

0x000f08b0 · 235 bytes · __cdecl

_Z18VOX_LookupEntIndexiib

Decompiled

undefined (3 params)

/* VOX_LookupEntIndex(int, int, bool) */

int VOX_LookupEntIndex(int param_1,int param_2,bool param_3)

{
  int iVar1;
  int iVar2;
  int *piVar3;
  undefined4 *puVar4;
  
  piVar3 = &g_entnames;
  iVar1 = 0;
  while ((*piVar3 != param_1 || (piVar3[1] != param_2))) {
    iVar1 = iVar1 + 1;
    piVar3 = piVar3 + 0x1a;
    if (iVar1 == 0x40) {
      if (!param_3) {
        return -1;
      }
      iVar1 = g_entnamelastsaved + 1;
      if (0x3f < iVar1) {
        iVar1 = 0;
      }
      g_entnamelastsaved = iVar1;
      (&g_entnames)[iVar1 * 0x1a] = param_1;
      iVar2 = 0;
      (&DAT_0034e9e4)[iVar1 * 0x1a] = param_2;
      (&DAT_0034ea44)[iVar1 * 0x1a] = 0;
      (&DAT_0034ea10)[iVar1 * 0x68] = 0;
      (&DAT_0034e9e8)[iVar1 * 0x1a] = 0;
      (&DAT_0034e9ec)[iVar1 * 0x1a] = 0;
      puVar4 = &DAT_0034e9f0 + iVar1 * 0x1a;
      do {
        iVar2 = iVar2 + 1;
        *puVar4 = 0;
        puVar4[0xd] = 0;
        puVar4[9] = 0;
        puVar4[0x11] = 0;
        puVar4[4] = 0;
        puVar4 = puVar4 + 1;
      } while (iVar2 != 4);
      return iVar1;
    }
  }
  (&DAT_0034ea10)[iVar1 * 0x68] = 0;
  return iVar1;
}

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)