L L4D2node

CAI_LocalIdSpace::AddSymbol

0x005b3920 · 251 bytes · __thiscall

_ZN16CAI_LocalIdSpace9AddSymbolEPKciS1_S1_

Decompiled

undefined (5 params)

/* CAI_LocalIdSpace::AddSymbol(char const*, int, char const*, char const*) */

undefined4 __thiscall
CAI_LocalIdSpace::AddSymbol
          (CAI_LocalIdSpace *this,char *param_1,int param_2,char *param_3,char *param_4)

{
  CAI_GlobalNamespace *this_00;
  int iVar1;
  int iVar2;
  undefined4 uVar3;
  
  this_00 = *(CAI_GlobalNamespace **)(this + 0x14);
  if (this_00 == (CAI_GlobalNamespace *)0x0) {
    DevMsg("ERROR: Adding symbol to uninitialized table %s\n",param_4);
    uVar3 = 0;
  }
  else {
    iVar2 = *(int *)(this + 4);
    if (iVar2 == 9999) {
      *(int *)(this + 4) = param_2;
      iVar2 = param_2;
      if (((*(int *)(this + 0x10) != 0) &&
          (iVar1 = *(int *)(*(int *)(this + 0x10) + 4), iVar1 != 9999)) && (param_2 <= iVar1)) {
        DevMsg("ERROR: Bad %s LOCALID for %s\n",param_3,param_4);
        return 0;
      }
    }
    else if (param_2 < iVar2) {
      DevMsg("ERROR: %s First added %s must be first LOCALID!\n",param_3,param_4);
      return 0;
    }
    if (*(int *)(this + 8) == -1) {
      *(int *)(this + 8) = iVar2;
      *(undefined4 *)(this + 0xc) = *(undefined4 *)this;
    }
    else if (*(int *)(this + 8) < param_2) {
      *(int *)(this + 8) = param_2;
      *(int *)(this + 0xc) = *(int *)this + (param_2 - iVar2);
    }
    iVar2 = LocalToGlobal(this,param_2);
    CAI_GlobalNamespace::AddSymbol(this_00,param_1,iVar2);
    uVar3 = 1;
  }
  return uVar3;
}

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)