L L4D2node

CNavMesh::ScriptGetNavAreasOverlappingEntityExtent

0x00742090 · 1550 bytes · __thiscall

_ZN8CNavMesh40ScriptGetNavAreasOverlappingEntityExtentEP9HSCRIPT__S1_

Decompiled

undefined (3 params)

/* CNavMesh::ScriptGetNavAreasOverlappingEntityExtent(HSCRIPT__*, HSCRIPT__*) */

void __thiscall
CNavMesh::ScriptGetNavAreasOverlappingEntityExtent
          (CNavMesh *this,HSCRIPT__ *param_1,HSCRIPT__ *param_2)

{
  int *piVar1;
  code *pcVar2;
  CNavArea *this_00;
  char cVar3;
  ScriptClassDesc_t *pSVar4;
  CBaseEntity *this_01;
  int iVar5;
  int iVar6;
  int in_GS_OFFSET;
  float fVar7;
  int local_19c;
  int local_198;
  int local_194;
  int local_190;
  int local_18c;
  CUtlMemory<CNavArea*,int> *local_188;
  CNavArea *local_178;
  char local_174;
  int *local_170;
  undefined4 local_16c;
  undefined4 local_168;
  int local_164;
  int *local_160;
  float local_15c;
  float local_158;
  float local_154;
  float local_150;
  float local_14c;
  float local_148;
  void *local_144;
  float local_140;
  float local_13c;
  float local_138;
  float local_134;
  float local_130;
  CFmtStrN<256> local_12c [5];
  undefined1 local_127 [263];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_1 != (HSCRIPT__ *)0x0) {
    pcVar2 = *(code **)(*g_pScriptVM + 0x68);
    pSVar4 = GetScriptDesc<CBaseEntity>((CBaseEntity *)0x0);
    this_01 = (CBaseEntity *)(*pcVar2)(g_pScriptVM,param_1,pSVar4);
    if ((this_01 != (CBaseEntity *)0x0) && (param_2 + -1 < (HSCRIPT__ *)0xfffffffe)) {
      local_170 = (int *)0x0;
      local_16c = 0;
      local_168 = 0;
      local_164 = 0;
      local_160 = (int *)0x0;
      local_174 = '\0';
                    /* try { // try from 0074217c to 007424c3 has its CatchHandler @ 007426ee */
      CCollisionProperty::CollisionAABBToWorldAABB
                ((CCollisionProperty *)(this_01 + 0x194),(Vector *)(this_01 + 0x19c),
                 (Vector *)(this_01 + 0x1a8),(Vector *)&local_15c,(Vector *)&local_150);
      if ((*(char **)(this_01 + 0x7c) == "prop_physics") ||
         (((cVar3 = CBaseEntity::ClassMatchesComplex(this_01,"prop_physics"), cVar3 != '\0' ||
           (*(char **)(this_01 + 0x7c) == "trigger_hurt")) ||
          (cVar3 = CBaseEntity::ClassMatchesComplex(this_01,"trigger_hurt"), cVar3 != '\0')))) {
        local_154 = local_154 - 71.0;
      }
      if (*(int *)(this + 0x18) != 0) {
        if ((ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
             searchMarker == '\0') &&
           (iVar5 = __cxa_guard_acquire(&ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)
                                         ::searchMarker), iVar5 != 0)) {
                    /* try { // try from 00742638 to 0074263c has its CatchHandler @ 007426ad */
          ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
          searchMarker = RandomInt(0,0x100000);
          __cxa_guard_release(&ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)
                               ::searchMarker);
        }
        iVar5 = ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
                searchMarker + 1;
        if (ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
            searchMarker + 1 == 0) {
          iVar5 = ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
                  searchMarker + 2;
        }
        ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
        searchMarker = iVar5;
        fVar7 = 1.0 / *(float *)(this + 0x20);
        iVar5 = (int)((local_15c - *(float *)(this + 0x2c)) * fVar7);
        if (iVar5 < 0) {
          local_190 = 0;
        }
        else {
          local_190 = *(int *)(this + 0x24) + -1;
          if (iVar5 < *(int *)(this + 0x24)) {
            local_190 = iVar5;
          }
        }
        iVar5 = (int)((local_150 - *(float *)(this + 0x2c)) * fVar7);
        if (iVar5 < 0) {
          local_198 = 0;
        }
        else {
          local_198 = *(int *)(this + 0x24) + -1;
          if (iVar5 < *(int *)(this + 0x24)) {
            local_198 = iVar5;
          }
        }
        iVar5 = (int)((local_158 - *(float *)(this + 0x30)) * fVar7);
        if (iVar5 < 0) {
          local_19c = 0;
        }
        else {
          local_19c = *(int *)(this + 0x28) + -1;
          if (iVar5 < *(int *)(this + 0x28)) {
            local_19c = iVar5;
          }
        }
        iVar5 = (int)((local_14c - *(float *)(this + 0x30)) * fVar7);
        if (iVar5 < 0) {
          local_194 = 0;
        }
        else {
          local_194 = *(int *)(this + 0x28) + -1;
          if (iVar5 < *(int *)(this + 0x28)) {
            local_194 = iVar5;
          }
        }
        for (; local_190 <= local_198; local_190 = local_190 + 1) {
          if (local_19c <= local_194) {
            iVar5 = local_19c * *(int *)(this + 0x24) + local_190;
            if (iVar5 < *(int *)(this + 0x18)) {
              local_18c = local_19c;
              do {
                iVar6 = 0;
                piVar1 = (int *)(*(int *)(this + 0xc) + iVar5 * 0x14);
                if (0 < piVar1[3]) {
                  do {
                    this_00 = *(CNavArea **)(*piVar1 + iVar6 * 4);
                    if (*(int *)(this_00 + 0x74) !=
                        ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)
                        ::searchMarker) {
                      *(int *)(this_00 + 0x74) =
                           ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)
                           ::searchMarker;
                      CNavArea::GetExtent(this_00,(Extent *)&local_144);
                      if (((local_15c <= local_138) && ((float)local_144 <= local_150)) &&
                         ((local_158 <= local_134 &&
                          (((local_140 <= local_14c && (local_154 <= local_130)) &&
                           (local_13c <= local_148)))))) {
                        local_178 = this_00;
                        if ((local_174 == '\0') || (local_164 < 1)) {
LAB_007425cc:
                    /* try { // try from 007425e3 to 007425e7 has its CatchHandler @ 007426ee */
                          CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
                                    ((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)&local_170,
                                     local_164,&local_178);
                        }
                        else if (this_00 != (CNavArea *)*local_170) {
                          iVar5 = 0;
                          do {
                            iVar5 = iVar5 + 1;
                            if (iVar5 == local_164) goto LAB_007425cc;
                          } while (this_00 != (CNavArea *)local_170[iVar5]);
                          if (iVar5 < 0) goto LAB_007425cc;
                        }
                      }
                    }
                    iVar6 = iVar6 + 1;
                  } while (iVar6 < piVar1[3]);
                }
                local_18c = local_18c + 1;
                if (local_194 < local_18c) goto LAB_0074268f;
                iVar5 = local_18c * *(int *)(this + 0x24) + local_190;
                if (*(int *)(this + 0x18) <= iVar5) break;
              } while( true );
            }
            if (ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
                __executeCount < 10) {
              ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
              __executeCount =
                   ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
                   __executeCount + 1;
              Warning("** Walked off of the CNavMesh::m_grid in ForAllAreasOverlappingExtent()\n");
            }
            break;
          }
LAB_0074268f:
        }
      }
      local_188 = (CUtlMemory<CNavArea*,int> *)&local_170;
      iVar5 = 0;
      if (0 < local_164) {
        do {
          if ((TerrorNavArea *)local_170[iVar5] != (TerrorNavArea *)0x0) {
            pcVar2 = *(code **)(*g_pScriptVM + 0x78);
            local_144 = (void *)TerrorNavArea::GetScriptInstance((TerrorNavArea *)local_170[iVar5]);
            local_13c = 4.48416e-44;
                    /* try { // try from 007424fa to 00742520 has its CatchHandler @ 007426dd */
            CFmtStrN<256>::CFmtStrN(local_12c,"area%i",iVar5);
            (*pcVar2)(g_pScriptVM,param_2,local_127,&local_144);
            if (((uint)local_13c & 0x10000) != 0) {
              free(local_144);
            }
          }
          iVar5 = iVar5 + 1;
        } while (iVar5 < local_164);
      }
      local_164 = 0;
      CUtlMemory<CNavArea*,int>::Purge(local_188);
      local_160 = local_170;
      CUtlMemory<CNavArea*,int>::Purge(local_188);
    }
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)