L L4D2node

CM_WriteAreaBits

0x0011b8c0 · 282 bytes · __cdecl

_Z16CM_WriteAreaBitsPhii

Decompiled

undefined (3 params)

/* CM_WriteAreaBits(unsigned char*, int, int) */

int CM_WriteAreaBits(uchar *param_1,int param_2,int param_3)

{
  int iVar1;
  int iVar2;
  int iVar3;
  
  if (param_2 < 0x20) {
    Sys_Error("CM_WriteAreaBits with buffer size %d < 32\n",param_2);
  }
  iVar2 = DAT_00394524 + 7 >> 3;
  if (*(int *)(map_noareas._28_4_ + 0x30) == 0) {
    _V_memset(param_1,0,param_2);
    if ((param_3 < 0) || (DAT_0039452c <= param_3)) {
      Error("Cannot load corrupted map.\n");
    }
    iVar3 = 0;
    iVar1 = *(int *)(param_3 * 0x10 + DAT_00394528 + 8);
    if (0 < DAT_00394524) {
      do {
        if (DAT_0039452c <= iVar3) {
          Error("Cannot load corrupted map.\n");
        }
        if ((*(int *)(iVar3 * 0x10 + DAT_00394528 + 8) == iVar1) || (param_3 == 0)) {
          param_1[iVar3 >> 3] = param_1[iVar3 >> 3] | (byte)(1 << ((byte)iVar3 & 7));
        }
        iVar3 = iVar3 + 1;
      } while (iVar3 < DAT_00394524);
      return iVar2;
    }
  }
  else {
    _V_memset(param_1,-(uint)(*(int *)(map_noareas._28_4_ + 0x30) != 2) & 0xff,param_2);
  }
  return iVar2;
}

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)