L L4D2node

CM_LeavesConnected

0x0011b770 · 317 bytes · __cdecl

_Z18CM_LeavesConnectedRK6VectoriPKiPb

Decompiled

undefined (4 params)

/* CM_LeavesConnected(Vector const&, int, int const*, bool*) */

void CM_LeavesConnected(Vector *param_1,int param_2,int *param_3,bool *param_4)

{
  int iVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  
  if (*(int *)(map_noareas._28_4_ + 0x30) != 0) {
    memset(param_4,1,param_2);
    return;
  }
  iVar2 = 0;
  if (DAT_0039437c != 0) {
    iVar2 = CM_PointLeafnum_r((CCollisionBSPData *)&g_BSPData,param_1,0);
  }
  iVar3 = 0;
  iVar2 = CM_LeafArea(iVar2);
  if (0 < param_2) {
    do {
      iVar4 = param_3[iVar3];
      if ((iVar4 < 0) || (DAT_0039439c <= iVar4)) {
        Error("Cannot load corrupted map.\n");
      }
      iVar4 = (int)((short)(*(short *)(iVar4 * 0x10 + DAT_00394398 + 6) << 7) >> 7);
      if ((iVar2 < 0) || (DAT_0039452c <= iVar2)) {
        Error("Cannot load corrupted map.\n");
      }
      iVar1 = *(int *)(DAT_00394528 + 8 + iVar2 * 0x10);
      if ((iVar4 < 0) || (DAT_0039452c <= iVar4)) {
        Error("Cannot load corrupted map.\n");
      }
      param_4[iVar3] = iVar1 == *(int *)(DAT_00394528 + 8 + iVar4 * 0x10);
      iVar3 = iVar3 + 1;
    } while (iVar3 != param_2);
  }
  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)