L L4D2node

GlobalEntity_Add

0x006d7140 · 292 bytes · __cdecl

_Z16GlobalEntity_AddPKcS0_12GLOBALESTATE

Decompiled

undefined (3 params)

/* GlobalEntity_Add(char const*, char const*, GLOBALESTATE) */

int GlobalEntity_Add(undefined4 param_1,undefined4 param_2,undefined4 param_3)

{
  short *psVar1;
  undefined4 uVar2;
  short sVar3;
  short sVar4;
  int iVar5;
  int iVar6;
  short local_2a;
  short local_28 [4];
  undefined4 local_20;
  
  CUtlSymbolTable::AddString((char *)local_28);
  sVar3 = local_28[0];
  CUtlSymbolTable::AddString((char *)local_28);
  sVar4 = local_28[0];
  local_2a = sVar3;
  CUtlSymbolTable::String((CUtlSymbolTable *)(gGlobalState + 0xc),&local_2a,param_2);
  CUtlSymbolTable::Find((char *)local_28);
  uVar2 = gGlobalState._84_4_;
  if ((local_28[0] == -1) || (iVar5 = gGlobalState._84_4_ + -1, iVar5 < 0)) {
LAB_006d7203:
    CUtlVector<globalentity_t,CUtlMemory<globalentity_t,int>>::GrowVector
              ((CUtlVector<globalentity_t,CUtlMemory<globalentity_t,int>> *)(gGlobalState + 0x48),1)
    ;
    CUtlVector<globalentity_t,CUtlMemory<globalentity_t,int>>::ShiftElementsRight
              ((CUtlVector<globalentity_t,CUtlMemory<globalentity_t,int>> *)(gGlobalState + 0x48),
               uVar2,1);
    psVar1 = (short *)(gGlobalState._72_4_ + uVar2 * 0xc);
    iVar5 = uVar2;
    if (psVar1 != (short *)0x0) {
      *psVar1 = sVar3;
      *(undefined4 *)(psVar1 + 2) = param_3;
      psVar1[1] = sVar4;
      *(undefined4 *)(psVar1 + 4) = local_20;
    }
  }
  else if (local_28[0] != *(short *)(gGlobalState._72_4_ + iVar5 * 0xc)) {
    iVar6 = gGlobalState._72_4_ + 0xc + iVar5 * 0xc;
    do {
      iVar5 = iVar5 + -1;
      if (iVar5 == -1) goto LAB_006d7203;
      psVar1 = (short *)(iVar6 + -0x18);
      iVar6 = iVar6 + -0xc;
    } while (local_28[0] != *psVar1);
  }
  return iVar5;
}

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)