L L4D2node

CConstraintFloodList::BuildGraphFromEntity

0x00782790 · 1473 bytes · __thiscall

_ZN20CConstraintFloodList20BuildGraphFromEntityEP11CBaseEntityR10CUtlVectorIS1_10CUtlMemoryIS1_iEE

Decompiled

undefined (3 params)

/* CConstraintFloodList::BuildGraphFromEntity(CBaseEntity*, CUtlVector<CBaseEntity*,
   CUtlMemory<CBaseEntity*, int> >&) */

void __thiscall
CConstraintFloodList::BuildGraphFromEntity
          (CConstraintFloodList *this,CBaseEntity *param_1,CUtlVector *param_2)

{
  int iVar1;
  int *piVar2;
  int *piVar3;
  int *piVar4;
  int *piVar5;
  int *piVar6;
  int *piVar7;
  int *piVar8;
  int *piVar9;
  int *piVar10;
  ushort uVar11;
  int iVar12;
  int local_8c;
  int local_7c;
  int local_78;
  int local_70;
  int local_68;
  int local_60;
  int local_58;
  int local_50;
  CBaseEntity *local_44;
  CBaseEntity *local_40;
  CBaseEntity *local_3c;
  CBaseEntity *local_38;
  CBaseEntity *local_34;
  CBaseEntity *local_30;
  CBaseEntity *local_2c;
  CBaseEntity *local_28;
  CBaseEntity *local_24 [5];
  
  local_24[0] = param_1;
  uVar11 = CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
           ::Find((CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                   *)this,(Node_t *)local_24);
  if (uVar11 != 0xffff) {
    piVar2 = (int *)(*(int *)(this + 0x1c) +
                    *(int *)((uint)uVar11 * 0x10 + *(int *)(this + 4) + 0xc) * 0x18);
    if ((char)piVar2[5] == '\0') {
      if (*(char *)((int)piVar2 + 0x15) != '\0') {
        CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>::InsertBefore
                  ((CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>> *)param_2,
                   *(int *)(param_2 + 0xc),&param_1);
      }
      *(undefined1 *)(piVar2 + 5) = 1;
      if (0 < piVar2[3]) {
        local_68 = 0;
        do {
          local_44 = *(CBaseEntity **)(*piVar2 + local_68 * 4);
          local_24[0] = local_44;
          uVar11 = CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                   ::Find((CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                           *)this,(Node_t *)local_24);
          if (uVar11 != 0xffff) {
            piVar3 = (int *)(*(int *)(this + 0x1c) +
                            *(int *)((uint)uVar11 * 0x10 + *(int *)(this + 4) + 0xc) * 0x18);
            if ((char)piVar3[5] == '\0') {
              if (*(char *)((int)piVar3 + 0x15) != '\0') {
                CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>::InsertBefore
                          ((CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>> *)param_2,
                           *(int *)(param_2 + 0xc),&local_44);
              }
              *(undefined1 *)(piVar3 + 5) = 1;
              if (0 < piVar3[3]) {
                local_78 = 0;
                do {
                  local_40 = *(CBaseEntity **)(*piVar3 + local_78 * 4);
                  local_24[0] = local_40;
                  uVar11 = CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                           ::Find((CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                   *)this,(Node_t *)local_24);
                  if (uVar11 != 0xffff) {
                    piVar4 = (int *)(*(int *)(this + 0x1c) +
                                    *(int *)((uint)uVar11 * 0x10 + *(int *)(this + 4) + 0xc) * 0x18)
                    ;
                    if ((char)piVar4[5] == '\0') {
                      if (*(char *)((int)piVar4 + 0x15) != '\0') {
                        CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>::InsertBefore
                                  ((CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>> *)param_2,
                                   *(int *)(param_2 + 0xc),&local_40);
                      }
                      *(undefined1 *)(piVar4 + 5) = 1;
                      if (0 < piVar4[3]) {
                        local_70 = 0;
                        do {
                          local_3c = *(CBaseEntity **)(*piVar4 + local_70 * 4);
                          local_24[0] = local_3c;
                          uVar11 = CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                   ::Find((CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                           *)this,(Node_t *)local_24);
                          if (uVar11 != 0xffff) {
                            piVar5 = (int *)(*(int *)(this + 0x1c) +
                                            *(int *)((uint)uVar11 * 0x10 + *(int *)(this + 4) + 0xc)
                                            * 0x18);
                            if ((char)piVar5[5] == '\0') {
                              if (*(char *)((int)piVar5 + 0x15) != '\0') {
                                CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>::InsertBefore
                                          ((CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>> *)
                                           param_2,*(int *)(param_2 + 0xc),&local_3c);
                              }
                              *(undefined1 *)(piVar5 + 5) = 1;
                              if (0 < piVar5[3]) {
                                local_7c = 0;
                                do {
                                  local_38 = *(CBaseEntity **)(*piVar5 + local_7c * 4);
                                  local_24[0] = local_38;
                                  uVar11 = CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                           ::Find((
                                                  CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                                  *)this,(Node_t *)local_24);
                                  if (uVar11 != 0xffff) {
                                    piVar6 = (int *)(*(int *)(this + 0x1c) +
                                                    *(int *)((uint)uVar11 * 0x10 +
                                                             *(int *)(this + 4) + 0xc) * 0x18);
                                    if ((char)piVar6[5] == '\0') {
                                      if (*(char *)((int)piVar6 + 0x15) != '\0') {
                                        CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>::
                                        InsertBefore((
                                                  CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>
                                                  *)param_2,*(int *)(param_2 + 0xc),&local_38);
                                      }
                                      *(undefined1 *)(piVar6 + 5) = 1;
                                      if (0 < piVar6[3]) {
                                        local_8c = 0;
                                        do {
                                          local_34 = *(CBaseEntity **)(*piVar6 + local_8c * 4);
                                          local_24[0] = local_34;
                                          uVar11 = 
                                                  CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                                  ::Find((
                                                  CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                                  *)this,(Node_t *)local_24);
                                          if (uVar11 != 0xffff) {
                                            piVar7 = (int *)(*(int *)(this + 0x1c) +
                                                            *(int *)((uint)uVar11 * 0x10 +
                                                                     *(int *)(this + 4) + 0xc) *
                                                            0x18);
                                            if ((char)piVar7[5] == '\0') {
                                              if (*(char *)((int)piVar7 + 0x15) != '\0') {
                                                CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>
                                                ::InsertBefore((
                                                  CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>
                                                  *)param_2,*(int *)(param_2 + 0xc),&local_34);
                                              }
                                              *(undefined1 *)(piVar7 + 5) = 1;
                                              if (0 < piVar7[3]) {
                                                local_60 = 0;
                                                do {
                                                  local_30 = *(CBaseEntity **)
                                                              (*piVar7 + local_60 * 4);
                                                  local_24[0] = local_30;
                                                  uVar11 = 
                                                  CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                                  ::Find((
                                                  CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                                  *)this,(Node_t *)local_24);
                                                  if (uVar11 != 0xffff) {
                                                    piVar8 = (int *)(*(int *)(this + 0x1c) +
                                                                    *(int *)((uint)uVar11 * 0x10 +
                                                                             *(int *)(this + 4) +
                                                                            0xc) * 0x18);
                                                    if ((char)piVar8[5] == '\0') {
                                                      if (*(char *)((int)piVar8 + 0x15) != '\0') {
                                                                                                                
                                                  CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>
                                                  ::InsertBefore((
                                                  CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>
                                                  *)param_2,*(int *)(param_2 + 0xc),&local_30);
                                                  }
                                                  *(undefined1 *)(piVar8 + 5) = 1;
                                                  if (0 < piVar8[3]) {
                                                    local_58 = 0;
                                                    do {
                                                      local_2c = *(CBaseEntity **)
                                                                  (*piVar8 + local_58 * 4);
                                                      local_24[0] = local_2c;
                                                      uVar11 = 
                                                  CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                                  ::Find((
                                                  CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                                  *)this,(Node_t *)local_24);
                                                  if (uVar11 != 0xffff) {
                                                    piVar9 = (int *)(*(int *)(this + 0x1c) +
                                                                    *(int *)((uint)uVar11 * 0x10 +
                                                                             *(int *)(this + 4) +
                                                                            0xc) * 0x18);
                                                    if ((char)piVar9[5] == '\0') {
                                                      if (*(char *)((int)piVar9 + 0x15) != '\0') {
                                                                                                                
                                                  CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>
                                                  ::InsertBefore((
                                                  CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>
                                                  *)param_2,*(int *)(param_2 + 0xc),&local_2c);
                                                  }
                                                  *(undefined1 *)(piVar9 + 5) = 1;
                                                  if (0 < piVar9[3]) {
                                                    local_50 = 0;
                                                    do {
                                                      local_28 = *(CBaseEntity **)
                                                                  (*piVar9 + local_50 * 4);
                                                      local_24[0] = local_28;
                                                      uVar11 = 
                                                  CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                                  ::Find((
                                                  CUtlRBTree<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short,CUtlMap<CBaseEntity*,int,unsigned_short>::CKeyLess,CUtlMemory<UtlRBTreeNode_t<CUtlMap<CBaseEntity*,int,unsigned_short>::Node_t,unsigned_short>,unsigned_short>>
                                                  *)this,(Node_t *)local_24);
                                                  if ((uVar11 != 0xffff) &&
                                                     (piVar10 = (int *)(*(int *)(this + 0x1c) +
                                                                       *(int *)((uint)uVar11 * 0x10
                                                                                + *(int *)(this + 4)
                                                                               + 0xc) * 0x18),
                                                     (char)piVar10[5] == '\0')) {
                                                    if (*(char *)((int)piVar10 + 0x15) != '\0') {
                                                                                                            
                                                  CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>
                                                  ::InsertBefore((
                                                  CUtlVector<CBaseEntity*,CUtlMemory<CBaseEntity*,int>>
                                                  *)param_2,*(int *)(param_2 + 0xc),&local_28);
                                                  }
                                                  *(undefined1 *)(piVar10 + 5) = 1;
                                                  if (0 < piVar10[3]) {
                                                    iVar12 = 0;
                                                    do {
                                                      iVar1 = iVar12 * 4;
                                                      iVar12 = iVar12 + 1;
                                                      BuildGraphFromEntity
                                                                (this,*(CBaseEntity **)
                                                                       (*piVar10 + iVar1),param_2);
                                                    } while (iVar12 < piVar10[3]);
                                                  }
                                                  }
                                                  local_50 = local_50 + 1;
                                                  } while (local_50 < piVar9[3]);
                                                  }
                                                  }
                                                  }
                                                  local_58 = local_58 + 1;
                                                  } while (local_58 < piVar8[3]);
                                                  }
                                                  }
                                                  }
                                                  local_60 = local_60 + 1;
                                                } while (local_60 < piVar7[3]);
                                              }
                                            }
                                          }
                                          local_8c = local_8c + 1;
                                        } while (local_8c < piVar6[3]);
                                      }
                                    }
                                  }
                                  local_7c = local_7c + 1;
                                } while (local_7c < piVar5[3]);
                              }
                            }
                          }
                          local_70 = local_70 + 1;
                        } while (local_70 < piVar4[3]);
                      }
                    }
                  }
                  local_78 = local_78 + 1;
                } while (local_78 < piVar3[3]);
              }
            }
          }
          local_68 = local_68 + 1;
        } while (local_68 < piVar2[3]);
      }
    }
  }
  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)