L L4D2node

CTraceBulletEntityEnumerator::PerformMultiTrace

0x00529d50 · 1587 bytes · __thiscall

_ZN28CTraceBulletEntityEnumerator17PerformMultiTraceER5Ray_tRK6VectorjP12ITraceFilter

Decompiled

undefined (5 params)

/* CTraceBulletEntityEnumerator::PerformMultiTrace(Ray_t&, Vector const&, unsigned int,
   ITraceFilter*) */

undefined2 __thiscall
CTraceBulletEntityEnumerator::PerformMultiTrace
          (CTraceBulletEntityEnumerator *this,Ray_t *param_1,Vector *param_2,uint param_3,
          ITraceFilter *param_4)

{
  int iVar1;
  char cVar2;
  undefined4 *puVar3;
  int *piVar4;
  CTraceBulletEntityEnumerator CVar5;
  int iVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  undefined **local_dc;
  float local_d8;
  undefined4 local_d4;
  undefined4 local_d0;
  float local_cc;
  undefined4 local_c8;
  undefined4 local_c4;
  undefined4 local_c0;
  undefined4 local_bc;
  undefined4 local_b8;
  undefined4 local_b4;
  CTraceBulletEntityEnumerator local_b0;
  CTraceBulletEntityEnumerator local_af;
  undefined2 local_ae;
  float local_ac;
  undefined4 local_a8;
  undefined2 local_a4;
  CTraceBulletEntityEnumerator local_a2;
  CTraceBulletEntityEnumerator local_a1;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined2 local_90;
  undefined2 local_8e;
  int *local_8c;
  undefined4 local_88;
  undefined4 local_84;
  int local_80;
  float local_7c;
  float local_78;
  undefined4 local_74;
  undefined4 local_70;
  float local_6c;
  undefined4 local_68;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_5c;
  undefined4 local_58;
  undefined4 local_54;
  CTraceBulletEntityEnumerator local_50;
  CTraceBulletEntityEnumerator local_4f;
  undefined2 local_4e;
  float local_4c;
  undefined4 local_48;
  undefined2 local_44;
  CTraceBulletEntityEnumerator local_42;
  CTraceBulletEntityEnumerator local_41;
  undefined4 local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined2 local_30;
  undefined2 local_2e;
  int *local_2c;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_84 = 0xffffffff;
  local_80 = 0;
  local_dc = &PTR_ShouldHitEntity_00c2ac08;
  (**(code **)(*enginetrace + 0x14))(enginetrace,param_1,0x2004003,&local_dc,&local_d8);
  if (local_a1 != (CTraceBulletEntityEnumerator)0x0) {
    return 0;
  }
  if (local_8c == (int *)0x0) {
    local_84 = 0xffffffff;
    CVar5 = (CTraceBulletEntityEnumerator)0x0;
    piVar4 = (int *)0x0;
  }
  else {
    puVar3 = (undefined4 *)(**(code **)(*local_8c + 0xc))(local_8c);
    local_84 = *puVar3;
    piVar4 = local_8c;
    CVar5 = local_a1;
  }
  *(undefined4 *)(this + 0x14) = local_c8;
  this[0x2c] = local_b0;
  *(undefined4 *)(this + 0x18) = local_c4;
  *(undefined4 *)(this + 8) = local_d4;
  *(undefined4 *)(this + 0x1c) = local_c0;
  this[0x2d] = local_af;
  *(undefined4 *)(this + 0x20) = local_bc;
  *(undefined4 *)(this + 0xc) = local_d0;
  *(undefined4 *)(this + 0x24) = local_b8;
  *(undefined2 *)(this + 0x2e) = local_ae;
  *(undefined4 *)(this + 0x28) = local_b4;
  *(float *)(this + 4) = local_d8;
  *(float *)(this + 0x10) = local_cc;
  fVar8 = local_cc - local_d8;
  *(undefined4 *)(this + 0x34) = local_a8;
  *(float *)(this + 0x30) = local_ac;
  *(undefined2 *)(this + 0x38) = local_a4;
  this[0x3a] = local_a2;
  *(int **)(this + 0x50) = piVar4;
  this[0x3b] = CVar5;
  *(undefined4 *)(this + 0x40) = local_9c;
  *(undefined4 *)(this + 0x54) = local_88;
  *(undefined4 *)(this + 0x48) = local_94;
  *(undefined4 *)(this + 0x3c) = local_a0;
  *(undefined4 *)(this + 0x44) = local_98;
  *(undefined4 *)(this + 0x58) = local_84;
  *(undefined2 *)(this + 0x4c) = local_90;
  *(int *)(this + 0x5c) = local_80;
  *(undefined2 *)(this + 0x4e) = local_8e;
  *(float *)(param_1 + 0x10) = fVar8;
  fVar7 = *(float *)(this + 0x14) - *(float *)(this + 8);
  *(float *)(param_1 + 0x14) = fVar7;
  fVar9 = *(float *)(this + 0x18) - *(float *)(this + 0xc);
  *(undefined4 *)(param_1 + 0x40) = 0;
  *(float *)(param_1 + 0x18) = fVar9;
  *(undefined4 *)(param_1 + 0x38) = 0;
  *(undefined4 *)(param_1 + 0x34) = 0;
  *(undefined4 *)(param_1 + 0x30) = 0;
  param_1[0x45] = (Ray_t)(fVar8 * fVar8 + fVar9 * fVar9 + fVar7 * fVar7 != 0.0);
  param_1[0x44] = (Ray_t)0x1;
  *(undefined4 *)(param_1 + 0x28) = 0;
  *(undefined4 *)(param_1 + 0x24) = 0;
  *(undefined4 *)(param_1 + 0x20) = 0;
  *(undefined4 *)param_1 = *(undefined4 *)(this + 4);
  *(undefined4 *)(param_1 + 4) = *(undefined4 *)(this + 8);
  *(undefined4 *)(param_1 + 8) = *(undefined4 *)(this + 0xc);
  iVar6 = 0;
  (**(code **)(*partition + 0x40))(partition,1,param_1,0,this);
  if (0 < *(int *)(this + 0x260)) {
    do {
      while (iVar1 = *(int *)(this + iVar6 * 4 + 0x60), iVar1 == 0) {
LAB_0052a040:
        iVar6 = iVar6 + 1;
        if (*(int *)(this + 0x260) <= iVar6) goto LAB_0052a0a0;
      }
      cVar2 = (**(code **)(*staticpropmgr + 8))(staticpropmgr,iVar1);
      if ((cVar2 != '\0') ||
         (cVar2 = (*(code *)**(undefined4 **)param_4)(param_4,iVar1,param_3), cVar2 != '\0')) {
        local_80 = (**(code **)(*enginetrace + 0x30))(enginetrace,iVar1);
        if (local_80 != 0) {
          (**(code **)(*enginetrace + 0x10))(enginetrace,param_1,param_3,local_80,&local_d8);
          if (local_a2 != (CTraceBulletEntityEnumerator)0x0) {
            return 0;
          }
          if (local_ac < 1.0) {
            if (local_8c == (int *)0x0) {
              local_84 = 0xffffffff;
              local_42 = (CTraceBulletEntityEnumerator)0x0;
              local_2c = (int *)0x0;
            }
            else {
              puVar3 = (undefined4 *)(**(code **)(*local_8c + 0xc))(local_8c);
              local_84 = *puVar3;
              local_2c = local_8c;
              local_42 = local_a2;
            }
            local_7c = local_ac;
            local_78 = local_d8;
            local_4c = local_ac;
            local_74 = local_d4;
            local_50 = local_b0;
            local_70 = local_d0;
            local_6c = local_cc;
            local_4f = local_af;
            local_68 = local_c8;
            local_64 = local_c4;
            local_4e = local_ae;
            local_60 = local_c0;
            local_5c = local_bc;
            local_48 = local_a8;
            local_58 = local_b8;
            local_54 = local_b4;
            local_44 = local_a4;
            local_41 = local_a1;
            local_3c = local_9c;
            local_28 = local_88;
            local_40 = local_a0;
            local_38 = local_98;
            local_34 = local_94;
            local_24 = local_84;
            local_30 = local_90;
            local_20 = local_80;
            local_2e = local_8e;
            CUtlRBTree<CUtlMap<float,CTraceBulletEntityEnumerator::BulletTrace_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<float,CTraceBulletEntityEnumerator::BulletTrace_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<float,CTraceBulletEntityEnumerator::BulletTrace_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
            ::Insert((CUtlRBTree<CUtlMap<float,CTraceBulletEntityEnumerator::BulletTrace_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<float,CTraceBulletEntityEnumerator::BulletTrace_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<float,CTraceBulletEntityEnumerator::BulletTrace_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                      *)(this + 0x268),(Node_t *)&local_7c);
          }
        }
        goto LAB_0052a040;
      }
      iVar6 = iVar6 + 1;
    } while (iVar6 < *(int *)(this + 0x260));
  }
LAB_0052a0a0:
  local_4c = *(float *)(this + 0x30);
  if (local_4c < 1.0) {
    local_42 = this[0x3a];
    local_41 = this[0x3b];
  }
  else if (this[0x3a] == (CTraceBulletEntityEnumerator)0x0) {
    if (this[0x3b] == (CTraceBulletEntityEnumerator)0x0) goto LAB_0052a1c4;
    local_41 = (CTraceBulletEntityEnumerator)0x1;
    local_42 = (CTraceBulletEntityEnumerator)0x0;
  }
  else {
    local_41 = this[0x3b];
    local_42 = (CTraceBulletEntityEnumerator)0x1;
  }
  local_78 = *(float *)(this + 4);
  local_50 = this[0x2c];
  local_7c = 1.0;
  local_74 = *(undefined4 *)(this + 8);
  local_70 = *(undefined4 *)(this + 0xc);
  local_4f = this[0x2d];
  local_6c = *(float *)(this + 0x10);
  local_68 = *(undefined4 *)(this + 0x14);
  local_4e = *(undefined2 *)(this + 0x2e);
  local_64 = *(undefined4 *)(this + 0x18);
  local_60 = *(undefined4 *)(this + 0x1c);
  local_48 = *(undefined4 *)(this + 0x34);
  local_5c = *(undefined4 *)(this + 0x20);
  local_58 = *(undefined4 *)(this + 0x24);
  local_44 = *(undefined2 *)(this + 0x38);
  local_54 = *(undefined4 *)(this + 0x28);
  local_3c = *(undefined4 *)(this + 0x40);
  local_38 = *(undefined4 *)(this + 0x44);
  local_40 = *(undefined4 *)(this + 0x3c);
  local_34 = *(undefined4 *)(this + 0x48);
  local_30 = *(undefined2 *)(this + 0x4c);
  local_2e = *(undefined2 *)(this + 0x4e);
  local_2c = *(int **)(this + 0x50);
  local_28 = *(undefined4 *)(this + 0x54);
  local_24 = *(undefined4 *)(this + 0x58);
  local_20 = *(int *)(this + 0x5c);
  CUtlRBTree<CUtlMap<float,CTraceBulletEntityEnumerator::BulletTrace_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<float,CTraceBulletEntityEnumerator::BulletTrace_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<float,CTraceBulletEntityEnumerator::BulletTrace_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
  ::Insert((CUtlRBTree<CUtlMap<float,CTraceBulletEntityEnumerator::BulletTrace_t,unsigned_short>::Node_t,unsigned_short,CUtlMap<float,CTraceBulletEntityEnumerator::BulletTrace_t,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<float,CTraceBulletEntityEnumerator::BulletTrace_t,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
            *)(this + 0x268),(Node_t *)&local_7c);
LAB_0052a1c4:
  return *(undefined2 *)(this + 0x27a);
}

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)