L L4D2node

CGameServer::PrecacheGeneric

0x0020a680 · 225 bytes · __thiscall

_ZN11CGameServer15PrecacheGenericEPKci

Decompiled

undefined (3 params)

/* CGameServer::PrecacheGeneric(char const*, int) */

int __thiscall CGameServer::PrecacheGeneric(CGameServer *this,char *param_1,int param_2)

{
  int *piVar1;
  int iVar2;
  CMapReslistGenerator *this_00;
  byte *pbVar3;
  byte local_1d [13];
  
  piVar1 = *(int **)(this + 0x2d36c);
  if ((piVar1 != (int *)0x0) &&
     (iVar2 = (**(code **)(*piVar1 + 0x24))(piVar1,1,param_1,0xffffffff,0), iVar2 != 0xffff)) {
    this_00 = (CMapReslistGenerator *)MapReslistGenerator();
    CMapReslistGenerator::OnResourcePrecached(this_00,param_1);
    pbVar3 = (byte *)(**(code **)(**(int **)(this + 0x2d36c) + 0x30))
                               (*(int **)(this + 0x2d36c),iVar2,0);
    if (pbVar3 == (byte *)0x0) {
      local_1d[0] = (byte)param_2 & 3;
    }
    else {
      local_1d[0] = *pbVar3 & 0xfc | (*pbVar3 | (byte)param_2) & 3;
    }
    (**(code **)(**(int **)(this + 0x2d36c) + 0x2c))(*(int **)(this + 0x2d36c),iVar2,1,local_1d);
    CPrecacheItem::SetGeneric((CPrecacheItem *)(this + iVar2 * 8 + 0x4264),param_1);
    return iVar2;
  }
  return -1;
}

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)