L L4D2node

TerrorNavMesh::UpdateBoundarySpread

0x00983430 · 1848 bytes · __thiscall

_ZN13TerrorNavMesh20UpdateBoundarySpreadEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* TerrorNavMesh::UpdateBoundarySpread() */

void __thiscall TerrorNavMesh::UpdateBoundarySpread(TerrorNavMesh *this)

{
  uint *puVar1;
  int *piVar2;
  int iVar3;
  CNavArea *pCVar4;
  bool bVar5;
  char cVar6;
  int iVar7;
  int iVar8;
  int *piVar9;
  int iVar10;
  int *piVar11;
  longdouble lVar12;
  float fVar13;
  float fVar14;
  int local_54;
  int local_50;
  CNavArea *local_38;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_34 = 0;
  local_30 = 0;
  if (_towlower == 0) {
    local_20 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_34,0,0,0,0,"/data/src/game/server/terror/terrornav.cpp",0x1568,
               &UpdateBoundarySpread()::tm_fmt,"(%s)%s","ZOMBIE",
               "TerrorNavMesh::UpdateBoundarySpread");
    local_20 = _towlower;
  }
  iVar3 = _DAT_0105db00;
  local_28 = local_34;
  local_24 = local_30;
                    /* try { // try from 009834de to 009834e2 has its CatchHandler @ 00983b14 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar7 = ThreadGetCurrentId(), iVar3 == iVar7)) {
    if ((char *)*_DAT_0105d15c != "TerrorNavMesh::UpdateBoundarySpread") {
                    /* try { // try from 00983aaa to 00983acd has its CatchHandler @ 00983b14 */
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd10990,(char *)0x0,0xc0db47);
    }
    puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
    *puVar1 = *puVar1 | 4;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  if (*(int *)(nav_edit._28_4_ + 0x30) == 0) {
                    /* try { // try from 00983578 to 009838aa has its CatchHandler @ 00983938 */
    lVar12 = (longdouble)CountdownTimer::Now();
    if ((*(float *)(this + 0x618) <= (float)lVar12) && (*(int *)(this + 0x628) != 0)) {
      if (*(int *)(ZombieBoundaryClearType._28_4_ + 0x30) == 0) {
        fVar14 = 2.0 / (float)*(int *)(this + 0x628);
        lVar12 = (longdouble)CountdownTimer::Now();
        if ((float)lVar12 + fVar14 != *(float *)(this + 0x618)) {
          (**(code **)(*(int *)(this + 0x610) + 4))(this + 0x610,this + 0x618);
          *(float *)(this + 0x618) = (float)lVar12 + fVar14;
        }
        if (fVar14 != *(float *)(this + 0x614)) {
          (**(code **)(*(int *)(this + 0x610) + 4))(this + 0x610,this + 0x614);
          *(float *)(this + 0x614) = fVar14;
        }
        pCVar4 = *(CNavArea **)(*(int *)(this + 0x61c) + *(int *)(this + 0x630) * 4);
        if (*(int *)(ZombieShowClear._28_4_ + 0x30) != 0) {
                    /* try { // try from 00983b50 to 00983b8c has its CatchHandler @ 00983938 */
          (**(code **)(*(int *)pCVar4 + 0x54))(pCVar4,0xff,0,0xff,0xff,0x3f800000,1);
        }
        local_38 = pCVar4;
        SearchSurroundingAreas<BoundarySpreadScan>
                  (pCVar4,(Vector *)(pCVar4 + 0x2c),(BoundarySpreadScan *)&local_38,
                   *(float *)(ZombieBoundaryMaxRange._28_4_ + 0x2c),0,-1);
        iVar3 = *(int *)(this + 0x630);
        *(int *)(this + 0x630) = iVar3 + 1;
        if (*(int *)(this + 0x628) <= iVar3 + 1) {
          *(undefined4 *)(this + 0x630) = 0;
        }
      }
      else {
        if (*(int *)(ZombieShowClear._28_4_ + 0x30) != 0) {
                    /* try { // try from 00983980 to 00983a46 has its CatchHandler @ 00983938 */
          (**(code **)(*engine + 0xbc))(engine,10,"%d cleared areas",*(undefined4 *)(this + 0x640));
        }
        local_50 = *(int *)(this + 0x640) + -1;
        if (-1 < local_50) {
          local_54 = local_50 * 4;
          do {
            piVar2 = *(int **)(*(int *)(this + 0x634) + local_54);
            if (*(int *)(ZombieShowClear._28_4_ + 0x30) != 0) {
                    /* try { // try from 00983930 to 00983932 has its CatchHandler @ 00983938 */
              (**(code **)(*piVar2 + 0x54))(piVar2,0,0xff,0,100,0x3f000000,1);
            }
            bVar5 = false;
            piVar11 = piVar2;
            do {
              piVar9 = (int *)piVar11[0x16];
              iVar3 = *piVar9;
              if (0 < iVar3) {
                iVar10 = 0;
                iVar7 = iVar3;
                do {
                  if (iVar7 < 1) {
LAB_0098364b:
                    local_38 = (CNavArea *)0x0;
                  }
                  else {
                    iVar8 = 0;
                    if (iVar10 != 0) {
                      do {
                        iVar8 = iVar8 + 1;
                        if (iVar8 == iVar7) goto LAB_0098364b;
                      } while (iVar8 != iVar10);
                    }
                    local_38 = (CNavArea *)piVar9[iVar8 * 2 + 1];
                  }
                  cVar6 = TerrorNavArea::IsCleared((TerrorNavArea *)local_38,(CTerrorPlayer *)0x0);
                  pCVar4 = local_38;
                  if (cVar6 != '\0') {
                    if ((((local_38[0x145] != (CNavArea)0x0) && (local_38[0x7d] == (CNavArea)0x0))
                        && ((*(float *)(local_38 + 0x14c) <= 0.0 ||
                            (lVar12 = (longdouble)IntervalTimer::Now(),
                            2.0 <= (float)lVar12 - *(float *)(pCVar4 + 0x14c))))) &&
                       (pCVar4 = local_38, (float)piVar2[0x54] <= *(float *)(local_38 + 0x150))) {
                      fVar14 = SQRT((*(float *)(local_38 + 0x30) - (float)piVar2[0xc]) *
                                    (*(float *)(local_38 + 0x30) - (float)piVar2[0xc]) +
                                    (*(float *)(local_38 + 0x2c) - (float)piVar2[0xb]) *
                                    (*(float *)(local_38 + 0x2c) - (float)piVar2[0xb]) +
                                    (*(float *)(local_38 + 0x34) - (float)piVar2[0xd]) *
                                    (*(float *)(local_38 + 0x34) - (float)piVar2[0xd])) /
                               *(float *)(ZombieBoundarySpreadSpeed._28_4_ + 0x2c);
                      if (0.0 < *(float *)(local_38 + 0x16c)) {
                        lVar12 = (longdouble)IntervalTimer::Now();
                        fVar13 = (float)lVar12 - *(float *)(pCVar4 + 0x16c);
                      }
                      else {
                        fVar13 = 99999.9;
                      }
                      if (fVar14 < fVar13) {
                        if (0.0 < (float)piVar2[0x5b]) {
                          lVar12 = (longdouble)IntervalTimer::Now();
                          fVar13 = (float)lVar12 - (float)piVar2[0x5b];
                        }
                        else {
                          fVar13 = 99999.9;
                        }
                        if (fVar14 < fVar13) {
                          TerrorNavArea::MarkAreaNotCleared((TerrorNavArea *)local_38);
                          CUtlVector<TerrorNavArea*,CUtlMemory<TerrorNavArea*,int>>::InsertBefore
                                    ((CUtlVector<TerrorNavArea*,CUtlMemory<TerrorNavArea*,int>> *)
                                     (this + 0x634),*(int *)(this + 0x640),
                                     (TerrorNavArea **)&local_38);
                          if (*(int *)(ZombieShowClear._28_4_ + 0x30) != 0) {
                            (**(code **)(*(int *)local_38 + 0x54))
                                      (local_38,0xff,100,0,0xff,0x40a00000,1);
                          }
                        }
                      }
                    }
                    bVar5 = true;
                  }
                  iVar10 = iVar10 + 1;
                  if (iVar10 == iVar3) break;
                  piVar9 = (int *)piVar11[0x16];
                  iVar7 = *piVar9;
                } while( true );
              }
              piVar11 = piVar11 + 1;
            } while (piVar11 != piVar2 + 4);
            if ((!bVar5) && ((*(byte *)((int)piVar2 + 0x12d) & 4) == 0)) {
              if (*(int *)(ZombieShowClear._28_4_ + 0x30) != 0) {
                (**(code **)(*piVar2 + 0x54))(piVar2,0,100,0xff,0xff,0x3f000000,1);
              }
              CUtlVector<TerrorNavArea*,CUtlMemory<TerrorNavArea*,int>>::FastRemove
                        ((CUtlVector<TerrorNavArea*,CUtlMemory<TerrorNavArea*,int>> *)(this + 0x634)
                         ,local_50);
            }
            local_50 = local_50 + -1;
            local_54 = local_54 + -4;
          } while (local_50 != -1);
        }
      }
      CVProfile::ExitScope((CVProfile *)&g_VProfCurrentProfile);
      Tm_Zone::~Tm_Zone((Tm_Zone *)&local_28);
      return;
    }
  }
  else {
    *(undefined4 *)(this + 0x628) = 0;
    *(undefined4 *)(this + 0x640) = 0;
  }
  iVar3 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar7 = ThreadGetCurrentId(), iVar3 == iVar7)) {
    cVar6 = CVProfNode::ExitScope();
    if (cVar6 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_20 != 0) {
    (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
  }
  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)