L L4D2node

CPhysicsProp::NavThink

0x007f8ff0 · 1034 bytes · __thiscall

_ZN12CPhysicsProp8NavThinkEv

Decompiled

undefined (1 param)

/* CPhysicsProp::NavThink() */

void __thiscall CPhysicsProp::NavThink(CPhysicsProp *this)

{
  int *piVar1;
  CNavArea *this_00;
  char cVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  longdouble lVar6;
  float fVar7;
  int local_88;
  int local_84;
  int local_80;
  int local_7c;
  CUtlMemory<CNavArea*,int> *local_78;
  int local_74;
  CNavArea *local_68;
  float local_64;
  float local_60;
  float local_5c;
  float local_58;
  float local_54;
  float local_50;
  char local_4c;
  int *local_48;
  undefined4 local_44;
  undefined4 local_40;
  int local_3c;
  int *local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  cVar2 = (**(code **)(*(int *)this + 0x478))(this);
  if (cVar2 == '\0') {
    return;
  }
  CCollisionProperty::CollisionAABBToWorldAABB
            ((CCollisionProperty *)(this + 0x194),(Vector *)(this + 0x19c),(Vector *)(this + 0x1a8),
             (Vector *)&local_64,(Vector *)&local_58);
  iVar5 = TheNavMesh;
  local_4c = '\0';
  local_48 = (int *)0x0;
  local_44 = 0;
  local_5c = local_5c - 71.0;
  local_40 = 0;
  local_3c = 0;
  local_38 = (int *)0x0;
  if (*(int *)(TheNavMesh + 0x18) != 0) {
    if ((CNavMesh::ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
         searchMarker == '\0') &&
       (iVar3 = __cxa_guard_acquire(&CNavMesh::
                                     ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)
                                     ::searchMarker), iVar3 != 0)) {
                    /* try { // try from 007f93a8 to 007f93ac has its CatchHandler @ 007f940b */
      CNavMesh::ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
      searchMarker = RandomInt(0,0x100000);
      __cxa_guard_release(&CNavMesh::
                           ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)
                           ::searchMarker);
    }
    iVar3 = CNavMesh::
            ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
            searchMarker + 1;
    if (CNavMesh::ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
        searchMarker + 1 == 0) {
      iVar3 = CNavMesh::
              ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
              searchMarker + 2;
    }
    CNavMesh::ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
    searchMarker = iVar3;
    fVar7 = 1.0 / *(float *)(iVar5 + 0x20);
    iVar3 = (int)((local_64 - *(float *)(iVar5 + 0x2c)) * fVar7);
    if (iVar3 < 0) {
      local_7c = 0;
    }
    else {
      local_7c = *(int *)(iVar5 + 0x24) + -1;
      if (iVar3 < *(int *)(iVar5 + 0x24)) {
        local_7c = iVar3;
      }
    }
    iVar3 = (int)((local_58 - *(float *)(iVar5 + 0x2c)) * fVar7);
    if (iVar3 < 0) {
      local_84 = 0;
    }
    else {
      local_84 = *(int *)(iVar5 + 0x24) + -1;
      if (iVar3 < *(int *)(iVar5 + 0x24)) {
        local_84 = iVar3;
      }
    }
    iVar3 = (int)((local_60 - *(float *)(iVar5 + 0x30)) * fVar7);
    if (iVar3 < 0) {
      local_88 = 0;
    }
    else {
      local_88 = *(int *)(iVar5 + 0x28) + -1;
      if (iVar3 < *(int *)(iVar5 + 0x28)) {
        local_88 = iVar3;
      }
    }
    iVar3 = (int)((local_54 - *(float *)(iVar5 + 0x30)) * fVar7);
    if (iVar3 < 0) {
      local_80 = 0;
    }
    else {
      local_80 = *(int *)(iVar5 + 0x28) + -1;
      if (iVar3 < *(int *)(iVar5 + 0x28)) {
        local_80 = iVar3;
      }
    }
    for (; local_7c <= local_84; local_7c = local_7c + 1) {
      if (local_88 <= local_80) {
        iVar3 = local_88 * *(int *)(iVar5 + 0x24) + local_7c;
        if (iVar3 < *(int *)(iVar5 + 0x18)) {
          local_74 = local_88;
          do {
            iVar4 = 0;
            piVar1 = (int *)(*(int *)(iVar5 + 0xc) + iVar3 * 0x14);
            if (0 < piVar1[3]) {
              do {
                this_00 = *(CNavArea **)(*piVar1 + iVar4 * 4);
                if (*(int *)(this_00 + 0x74) !=
                    CNavMesh::
                    ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)
                    ::searchMarker) {
                  *(int *)(this_00 + 0x74) =
                       CNavMesh::
                       ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)
                       ::searchMarker;
                    /* try { // try from 007f9204 to 007f9359 has its CatchHandler @ 007f9447 */
                  CNavArea::GetExtent(this_00,(Extent *)&local_34);
                  if (((((local_64 <= local_28) && (local_34 <= local_58)) && (local_60 <= local_24)
                       ) && ((local_30 <= local_54 && (local_5c <= local_20)))) &&
                     (local_2c <= local_50)) {
                    local_68 = this_00;
                    if ((local_4c == '\0') || (local_3c < 1)) {
LAB_007f9344:
                      CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>>::InsertBefore
                                ((CUtlVector<CNavArea*,CUtlMemory<CNavArea*,int>> *)&local_48,
                                 local_3c,&local_68);
                    }
                    else if (this_00 != (CNavArea *)*local_48) {
                      iVar3 = 0;
                      do {
                        iVar3 = iVar3 + 1;
                        if (iVar3 == local_3c) goto LAB_007f9344;
                      } while (this_00 != (CNavArea *)local_48[iVar3]);
                      if (iVar3 < 0) goto LAB_007f9344;
                    }
                  }
                }
                iVar4 = iVar4 + 1;
              } while (iVar4 < piVar1[3]);
            }
            local_74 = local_74 + 1;
            if (local_80 < local_74) goto LAB_007f93f6;
            iVar3 = local_74 * *(int *)(iVar5 + 0x24) + local_7c;
            if (*(int *)(iVar5 + 0x18) <= iVar3) break;
          } while( true );
        }
        if (CNavMesh::
            ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
            __executeCount < 10) {
          CNavMesh::ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)
          ::__executeCount =
               CNavMesh::
               ForAllAreasOverlappingExtent<NavAreaCollector>(NavAreaCollector&,Extent_const&)::
               __executeCount + 1;
          Warning("** Walked off of the CNavMesh::m_grid in ForAllAreasOverlappingExtent()\n");
        }
        break;
      }
LAB_007f93f6:
    }
  }
  local_78 = (CUtlMemory<CNavArea*,int> *)&local_48;
  lVar6 = (longdouble)(**(code **)(*(int *)this + 0x474))(this);
  iVar5 = 0;
  if (0 < local_3c) {
    do {
      CNavArea::MarkObstacleToAvoid((CNavArea *)local_48[iVar5],(float)lVar6);
      iVar5 = iVar5 + 1;
    } while (iVar5 < local_3c);
  }
  local_3c = 0;
  CUtlMemory<CNavArea*,int>::Purge(local_78);
  local_38 = local_48;
  CUtlMemory<CNavArea*,int>::Purge(local_78);
  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)