L L4D2node

CDecalVertCache::FindFreeBlocks

0x001da8d0 · 274 bytes · __thiscall

_ZN15CDecalVertCache14FindFreeBlocksEi

Decompiled

undefined (2 params)

/* CDecalVertCache::FindFreeBlocks(int) */

void __thiscall CDecalVertCache::FindFreeBlocks(CDecalVertCache *this,int param_1)

{
  uint uVar1;
  uint uVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  uint uVar6;
  int iVar7;
  
  iVar4 = s_aDecalPool;
  iVar3 = r_framecount;
  if ((*(int *)(this + 0x20000) < param_1) && (param_1 <= 0x400 - *(int *)(this + 0x20008))) {
    uVar6 = *(uint *)(this + 0x20010);
    uVar1 = uVar6 + 0x10;
    while (uVar6 != (uVar1 & 0x3ff)) {
      iVar5 = uVar6 * 0x80;
      if ((*(int *)(this + iVar5 + 0x4c) == 0) && (1 < iVar3 - *(int *)(this + iVar5 + 0x6c))) {
        iVar5 = *(int *)(iVar4 + *(int *)(this + iVar5 + 0xc) * 4);
        uVar6 = (uint)*(ushort *)(iVar5 + 0x50);
        while (uVar6 != 0xffff) {
          iVar7 = uVar6 * 0x80;
          *(undefined4 *)(this + iVar7 + 0x4c) = 1;
          uVar2 = *(uint *)(this + iVar7 + 0x2c);
          *(undefined4 *)(this + iVar7 + 0x2c) = *(undefined4 *)(this + 0x20004);
          *(undefined4 *)(this + iVar7 + 0xc) = 0xffffffff;
          *(int *)(this + 0x20000) = *(int *)(this + 0x20000) + 1;
          *(uint *)(this + 0x20004) = uVar6;
          uVar6 = uVar2;
        }
        *(undefined2 *)(iVar5 + 0x50) = 0xffff;
        *(undefined2 *)(iVar5 + 0x4e) = 0;
      }
      if (param_1 <= *(int *)(this + 0x20000)) {
        return;
      }
      uVar6 = *(int *)(this + 0x20010) + 1U & 0x3ff;
      *(uint *)(this + 0x20010) = uVar6;
    }
  }
  return;
}

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)