L L4D2node

CAppSystemGroup::AddSystem

0x0026bc60 · 164 bytes · __thiscall

_ZN15CAppSystemGroup9AddSystemEiPKc

Decompiled

undefined (3 params)

/* CAppSystemGroup::AddSystem(int, char const*) */

IAppSystem * __thiscall CAppSystemGroup::AddSystem(CAppSystemGroup *this,int param_1,char *param_2)

{
  undefined4 *puVar1;
  CSysModule *pCVar2;
  code *pcVar3;
  int local_18;
  IAppSystem *local_14;
  int local_10;
  
  if (param_1 == -1) {
    local_14 = (IAppSystem *)0x0;
  }
  else {
    puVar1 = (undefined4 *)(*(int *)(this + 4) + param_1 * 0xc);
    pCVar2 = (CSysModule *)*puVar1;
    if (pCVar2 == (CSysModule *)0x0) {
      pcVar3 = (code *)puVar1[1];
    }
    else {
      pcVar3 = (code *)Sys_GetFactory(pCVar2);
    }
    local_14 = (IAppSystem *)(*pcVar3)(param_2,&local_18);
    if ((local_18 == 0) && (local_14 != (IAppSystem *)0x0)) {
      local_10 = CUtlVector<IAppSystem*,CUtlMemory<IAppSystem*,int>>::InsertBefore
                           ((CUtlVector<IAppSystem*,CUtlMemory<IAppSystem*,int>> *)(this + 0x18),
                            *(int *)(this + 0x24),&local_14);
      CUtlDict<int,unsigned_short>::Insert
                ((CUtlDict<int,unsigned_short> *)(this + 0x2c),param_2,&local_10);
    }
    else {
      Warning("AppFramework : Unable to create system %s!\n",param_2);
      local_14 = (IAppSystem *)0x0;
    }
  }
  return local_14;
}

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)