L L4D2node

CVoxelHash::EnumerateElementsInBox

0x001df790 · 1109 bytes · __thiscall

_ZN10CVoxelHash22EnumerateElementsInBoxEi7Voxel_tS0_RK6VectorS3_P20IPartitionEnumerator

Decompiled

undefined (7 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CVoxelHash::EnumerateElementsInBox(int, Voxel_t, Voxel_t, Vector const&, Vector const&,
   IPartitionEnumerator*) */

bool __thiscall
CVoxelHash::EnumerateElementsInBox
          (CVoxelHash *this,undefined4 param_1,uint param_3,uint param_4,float *param_5,
          float *param_6,undefined4 param_7)

{
  bool bVar1;
  char cVar2;
  int iVar3;
  int *piVar4;
  int iVar5;
  float fVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  int local_a8;
  int local_9c;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_80;
  undefined4 local_7c;
  int local_78;
  undefined4 local_74;
  CUtlHashFast<int,CUtlHashFastNoHash> local_70 [72];
  undefined4 local_28;
  float *local_24;
  float *local_20;
  
  local_8c = 0;
  local_88 = 0;
  if (_exit == 0) {
    local_78 = 0;
  }
  else {
    (**(code **)(_exit + 0x50))
              (_exit,&local_8c,0,0,0,0,"/data/src/engine/./spatialpartition.cpp",0x3f2,
               &EnumerateElementsInBox(int,Voxel_t,Voxel_t,Vector_const&,Vector_const&,IPartitionEnumerator*)
                ::tm_fmt,"(%s)%s","Unaccounted","BoxTest/SphereTest");
    local_78 = _exit;
  }
  iVar5 = _DAT_0040b9d4;
  local_80 = local_8c;
  local_7c = local_88;
                    /* try { // try from 001df857 to 001df85b has its CatchHandler @ 001dfc2d */
  if (((_DAT_0040b028 != 0) || (DAT_0040b02c == '\0')) &&
     (iVar3 = ThreadGetCurrentId(), iVar5 == iVar3)) {
    if ((char *)*_DAT_0040b030 != "BoxTest/SphereTest") {
                    /* try { // try from 001dfb80 to 001dfb91 has its CatchHandler @ 001dfc2d */
      _DAT_0040b030 =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0040b030,0x2be3dc,&DAT_00000001,0x2a054b);
    }
    CVProfNode::EnterScope();
    DAT_0040b02c = '\0';
  }
  if (*param_6 < *param_5) {
    fVar9 = param_6[2];
    fVar6 = param_6[1];
    fVar8 = param_5[2];
    fVar7 = param_5[1];
  }
  else {
    fVar7 = param_5[1];
    fVar6 = param_6[1];
    if (fVar7 <= fVar6) {
      fVar8 = param_5[2];
      fVar9 = param_6[2];
      if ((fVar8 <= fVar9) && (param_3 <= param_4)) {
        iVar5 = *(int *)(this + 0x1048);
        CUtlHashFast<int,CUtlHashFastNoHash>::CUtlHashFast(local_70);
        piVar4 = (int *)___tls_get_addr();
        local_74 = *(undefined4 *)(iVar5 + 0x3c + *piVar4 * 4);
        local_28 = *(undefined4 *)(iVar5 + 0x38);
        local_24 = param_5;
        local_20 = param_6;
        if (param_3 == param_4) {
                    /* try { // try from 001dfbf1 to 001dfbf5 has its CatchHandler @ 001dfbfd */
          bVar1 = EnumerateElementsInSingleVoxel<CIntersectBox>
                            (this,param_3,&local_74,param_1,param_7);
        }
        else {
          local_a8 = 0;
          param_4 = param_4 - param_3;
          do {
            local_9c = 0;
            do {
              iVar5 = 0;
              do {
                    /* try { // try from 001dfabb to 001dfabf has its CatchHandler @ 001dfbfd */
                bVar1 = EnumerateElementsInVoxel<CIntersectBox>
                                  (this,(ushort)(((ushort)param_3 & 0x7ff) + (short)local_a8) &
                                        0x7ff | ((ushort)(((ushort)(param_3 >> 0xb) & 0x7ff) +
                                                         (short)local_9c) & 0x7ff) << 0xb |
                                        ((param_3 >> 0x16) + iVar5) * 0x400000,&local_74,param_1,
                                   param_7);
                if (!bVar1) goto LAB_001dfb08;
                iVar5 = iVar5 + 1;
              } while (iVar5 <= (int)(param_4 >> 0x16));
              local_9c = local_9c + 1;
            } while (local_9c <= (int)(param_4 >> 0xb & 0x7ff));
            local_a8 = local_a8 + 1;
          } while (local_a8 <= (int)(param_4 & 0x7ff));
        }
LAB_001dfb08:
        CUtlHashFast<int,CUtlHashFastNoHash>::~CUtlHashFast(local_70);
        goto LAB_001df8f9;
      }
    }
    else {
      fVar9 = param_6[2];
      fVar8 = param_5[2];
    }
  }
                    /* try { // try from 001df8ef to 001df8f3 has its CatchHandler @ 001dfc29 */
  DevMsg("Invalid voxel:{%g,%g,%g,%u}-{%g,%g,%g,%u}\n",(double)*param_5,(double)fVar7,(double)fVar8,
         param_3,(double)*param_6,(double)fVar6,(double)fVar9,param_4);
  bVar1 = true;
LAB_001df8f9:
  iVar5 = _DAT_0040b9d4;
  if (((DAT_0040b02c == '\0') || (_DAT_0040b028 != 0)) &&
     (iVar3 = ThreadGetCurrentId(), iVar5 == iVar3)) {
    cVar2 = CVProfNode::ExitScope();
    if (cVar2 != '\0') {
      _DAT_0040b030 = (int *)_DAT_0040b030[0x19];
    }
    DAT_0040b02c = _DAT_0040b030 == (int *)0x40b034;
  }
  if (local_78 != 0) {
    (**(code **)(local_78 + 0x54))(local_78,local_80,local_7c,0,0,0);
  }
  return bVar1;
}

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)