L L4D2node

CVoxelTree::EnumerateElementsAlongRay_Ray

0x001e0f30 · 1322 bytes · __thiscall

_ZN10CVoxelTree29EnumerateElementsAlongRay_RayEiRK5Ray_tRK6VectorS5_P20IPartitionEnumerator

Decompiled

undefined (6 params)

/* CVoxelTree::EnumerateElementsAlongRay_Ray(int, Ray_t const&, Vector const&, Vector const&,
   IPartitionEnumerator*) */

bool __thiscall
CVoxelTree::EnumerateElementsAlongRay_Ray
          (CVoxelTree *this,int param_1,Ray_t *param_2,Vector *param_3,Vector *param_4,
          IPartitionEnumerator *param_5)

{
  float *pfVar1;
  bool bVar2;
  int *piVar3;
  byte bVar4;
  uint uVar5;
  uint uVar6;
  uint uVar7;
  uint uVar8;
  bool local_e1;
  uint local_e0;
  uint local_dc;
  uint local_d8;
  uint local_d4;
  uint local_d0;
  short local_c0 [2];
  short local_bc;
  short local_b8;
  float local_b4;
  float local_b0;
  float local_ac;
  float local_a8;
  float local_a4;
  float local_a0;
  undefined4 local_9c;
  CUtlHashFast<int,CUtlHashFastNoHash> local_98 [72];
  undefined4 local_50;
  undefined4 local_4c;
  undefined4 uStack_48;
  undefined4 uStack_44;
  undefined4 uStack_40;
  undefined4 local_3c;
  undefined4 uStack_38;
  undefined4 uStack_34;
  undefined4 uStack_30;
  undefined4 local_2c;
  undefined4 uStack_28;
  undefined4 uStack_24;
  undefined4 uStack_20;
  
  pfVar1 = *(float **)(this + 8);
  bVar4 = SUB41(pfVar1[0x413],0) * '\x02' + 8;
  uVar6 = (int)(*(float *)param_2 - *pfVar1) >> (bVar4 & 0x1f) & 0x7ffU |
          ((int)(*(float *)(param_2 + 4) - pfVar1[1]) >> (bVar4 & 0x1f) & 0x7ffU) << 0xb |
          ((int)(*(float *)(param_2 + 8) - pfVar1[2]) >> (bVar4 & 0x1f)) << 0x16;
  uVar7 = (int)(*(float *)param_4 - *pfVar1) >> (bVar4 & 0x1f) & 0x7ffU |
          ((int)(*(float *)(param_4 + 4) - pfVar1[1]) >> (bVar4 & 0x1f) & 0x7ffU) << 0xb |
          ((int)(*(float *)(param_4 + 8) - pfVar1[2]) >> (bVar4 & 0x1f)) << 0x16;
  CUtlHashFast<int,CUtlHashFastNoHash>::CUtlHashFast(local_98);
  piVar3 = (int *)___tls_get_addr();
  local_9c = *(undefined4 *)(this + *piVar3 * 4 + 0x3c);
  local_50 = *(undefined4 *)(this + 0x38);
  local_4c = *(undefined4 *)param_2;
  uStack_48 = *(undefined4 *)(param_2 + 4);
  uStack_44 = *(undefined4 *)(param_2 + 8);
  uStack_40 = *(undefined4 *)(param_2 + 0xc);
  local_3c = *(undefined4 *)(param_2 + 0x10);
  uStack_38 = *(undefined4 *)(param_2 + 0x14);
  uStack_34 = *(undefined4 *)(param_2 + 0x18);
  uStack_30 = *(undefined4 *)(param_2 + 0x1c);
  local_2c = *(undefined4 *)param_3;
  uStack_28 = *(undefined4 *)(param_3 + 4);
  uStack_24 = *(undefined4 *)(param_3 + 8);
  uStack_20 = *(undefined4 *)(param_3 + 0xc);
  if (uVar7 == uVar6) {
    bVar2 = CVoxelHash::EnumerateElementsInSingleVoxel<CIntersectRay>
                      (*(CVoxelHash **)(this + 8),uVar7,&local_9c,param_1,param_5);
    if (bVar2) {
      uVar7 = uVar7 >> 2 & 0xffcff9ff;
      bVar2 = CVoxelHash::EnumerateElementsInSingleVoxel<CIntersectRay>
                        ((CVoxelHash *)(*(int *)(this + 8) + 0x1050),uVar7,&local_9c,param_1,param_5
                        );
      if (bVar2) {
        uVar7 = uVar7 >> 2 & 0xffcff9ff;
        bVar2 = CVoxelHash::EnumerateElementsInSingleVoxel<CIntersectRay>
                          ((CVoxelHash *)(*(int *)(this + 8) + 0x20a0),uVar7,&local_9c,param_1,
                           param_5);
        if (bVar2) {
          local_e1 = CVoxelHash::EnumerateElementsInSingleVoxel<CIntersectRay>
                               ((CVoxelHash *)(*(int *)(this + 8) + 0x30f0),uVar7 >> 2 & 0xffcff9ff,
                                &local_9c,param_1,param_5);
          goto LAB_001e1440;
        }
      }
    }
  }
  else {
    uVar7 = uVar6 >> 2 & 0xffcff9ff;
    CVoxelHash::LeafListRaySetup
              (*(CVoxelHash **)(this + 8),param_2,param_4,param_3,uVar6,local_c0,&local_b4,&local_a8
              );
    local_e0 = 0xffffffff;
    local_dc = 0xffffffff;
    local_d0 = uVar7 >> 2 & 0xffcff9ff;
    local_d8 = 0xffffffff;
    local_d4 = local_d0 >> 2 & 0xffcff9ff;
                    /* try { // try from 001e11ad to 001e1437 has its CatchHandler @ 001e1469 */
    while ((((uVar8 = uVar7,
             bVar2 = CVoxelHash::EnumerateElementsInVoxel<CIntersectRay>
                               (*(CVoxelHash **)(this + 8),uVar6,&local_9c,param_1,param_5), bVar2
             && ((uVar8 == local_d8 ||
                 (bVar2 = CVoxelHash::EnumerateElementsInVoxel<CIntersectRay>
                                    ((CVoxelHash *)(*(int *)(this + 8) + 0x1050),uVar8,&local_9c,
                                     param_1,param_5), bVar2)))) &&
            ((local_d0 == local_dc ||
             (bVar2 = CVoxelHash::EnumerateElementsInVoxel<CIntersectRay>
                                ((CVoxelHash *)(*(int *)(this + 8) + 0x20a0),local_d0,&local_9c,
                                 param_1,param_5), bVar2)))) &&
           ((local_d4 == local_e0 ||
            (bVar2 = CVoxelHash::EnumerateElementsInVoxel<CIntersectRay>
                               ((CVoxelHash *)(*(int *)(this + 8) + 0x30f0),local_d4,&local_9c,
                                param_1,param_5), bVar2))))) {
      if (((1.0 <= local_b4) && (1.0 <= local_b0)) && (local_e1 = true, 1.0 <= local_ac))
      goto LAB_001e1440;
      if (local_b4 < local_b0) {
        if (local_ac <= local_b4) goto LAB_001e1312;
        local_b4 = local_b4 + local_a8;
        uVar6 = uVar6 & 0xfffff800 | (ushort)(((ushort)uVar6 & 0x7ff) + local_c0[0]) & 0x7ff;
      }
      else if (local_ac <= local_b0) {
LAB_001e1312:
        local_ac = local_ac + local_a0;
        uVar6 = uVar6 & 0x3fffff | (uint)(ushort)((ushort)(uVar6 >> 0x16) + local_b8) << 0x16;
      }
      else {
        local_b0 = local_b0 + local_a4;
        uVar6 = uVar6 & 0xffc007ff |
                ((ushort)(((ushort)(uVar6 >> 0xb) & 0x7ff) + local_bc) & 0x7ff) << 0xb;
      }
      uVar7 = uVar6 >> 2 & 0xffcff9ff;
      uVar5 = uVar7 >> 2 & 0xffcff9ff;
      local_e0 = local_d4;
      local_d4 = uVar5 >> 2 & 0x3c0f81f;
      local_dc = local_d0;
      local_d8 = uVar8;
      local_d0 = uVar5;
    }
  }
  local_e1 = false;
LAB_001e1440:
  CUtlHashFast<int,CUtlHashFastNoHash>::~CUtlHashFast(local_98);
  return local_e1;
}

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)