L L4D2node

CDecalVertCache::AllocBlocks

0x001daa40 · 225 bytes · __thiscall

_ZN15CDecalVertCache11AllocBlocksEi

Decompiled

undefined (2 params)

/* CDecalVertCache::AllocBlocks(int) */

int __thiscall CDecalVertCache::AllocBlocks(CDecalVertCache *this,int param_1)

{
  int iVar1;
  undefined4 uVar2;
  int iVar3;
  CDecalVertCache *pCVar4;
  CDecalVertCache *pCVar5;
  int local_14;
  
  if (*(int *)(this + 0x20000) < param_1) {
    return 0xffff;
  }
  if (*(int *)(this + 0x20000) == 0) {
    pCVar5 = this + 0x7fff80;
    local_14 = 0xffff;
  }
  else {
    local_14 = *(int *)(this + 0x20004);
    pCVar5 = this + local_14 * 0x80;
    uVar2 = *(undefined4 *)(pCVar5 + 0x2c);
    *(undefined4 *)(pCVar5 + 0x4c) = 0;
    *(int *)(this + 0x20000) = *(int *)(this + 0x20000) + -1;
    *(undefined4 *)(this + 0x20004) = uVar2;
  }
  if (1 < param_1) {
    iVar3 = 1;
    while( true ) {
      if (*(int *)(this + 0x20000) == 0) {
        *(undefined4 *)(pCVar5 + 0x2c) = 0xffff;
        pCVar5 = this + 0x7fff80;
      }
      else {
        iVar1 = *(int *)(this + 0x20004);
        pCVar4 = this + iVar1 * 0x80;
        *(undefined4 *)(pCVar4 + 0x4c) = 0;
        uVar2 = *(undefined4 *)(pCVar4 + 0x2c);
        *(int *)(this + 0x20000) = *(int *)(this + 0x20000) + -1;
        *(undefined4 *)(this + 0x20004) = uVar2;
        *(int *)(pCVar5 + 0x2c) = iVar1;
        pCVar5 = pCVar4;
      }
      if (iVar3 + 1 == param_1) break;
      iVar3 = iVar3 + 1;
    }
  }
  *(undefined4 *)(pCVar5 + 0x2c) = 0xffff;
  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)