L L4D2node

CNavMesh::IncreaseDangerNearby

0x0073e4a0 · 626 bytes · __thiscall

_ZN8CNavMesh20IncreaseDangerNearbyEifP8CNavAreaRK6Vectorff

Decompiled

undefined (7 params)

/* CNavMesh::IncreaseDangerNearby(int, float, CNavArea*, Vector const&, float, float) */

void __thiscall
CNavMesh::IncreaseDangerNearby
          (CNavMesh *this,int param_1,float param_2,CNavArea *param_3,Vector *param_4,float param_5,
          float param_6)

{
  int iVar1;
  CNavArea *this_00;
  int iVar2;
  CNavArea *this_01;
  int *piVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  longdouble lVar7;
  float fVar8;
  
  if (param_3 != (CNavArea *)0x0) {
    iVar4 = CNavArea::m_masterMarker + 1;
    CNavArea::m_masterMarker = 1;
    if (iVar4 != 0) {
      CNavArea::m_masterMarker = iVar4;
    }
    CNavArea::ClearSearchLists();
    CNavArea::AddToOpenList(param_3);
    iVar4 = CNavArea::m_masterMarker;
    *(undefined4 *)(param_3 + 0x40) = 0;
    *(int *)(param_3 + 0x3c) = iVar4;
    fVar8 = param_2;
    if ((0.0 < param_6) &&
       (lVar7 = (longdouble)CNavArea::GetDanger(param_3,param_1), param_6 < (float)lVar7 + param_2))
    {
      lVar7 = (longdouble)CNavArea::GetDanger(param_3,param_1);
      fVar8 = param_6 - (float)lVar7;
    }
    CNavArea::IncreaseDanger(param_3,param_1,fVar8);
    while (this_00 = CNavArea::m_openList, CNavArea::m_openList = this_00,
          this_00 != (CNavArea *)0x0) {
      CNavArea::RemoveFromOpenList(this_00);
      *(undefined4 *)(this_00 + 0x4c) = 0;
      *(undefined4 *)(this_00 + 0x48) = 0;
      iVar4 = 0;
      do {
        piVar3 = *(int **)(this_00 + iVar4 * 4 + 0x58);
        iVar1 = *piVar3;
        if (0 < iVar1) {
          iVar6 = 0;
          iVar5 = iVar1;
          do {
            if (iVar5 < 1) {
LAB_0073e5d3:
              this_01 = (CNavArea *)0x0;
            }
            else {
              iVar2 = 0;
              if (iVar6 != 0) {
                do {
                  iVar2 = iVar2 + 1;
                  if (iVar2 == iVar5) goto LAB_0073e5d3;
                } while (iVar6 != iVar2);
              }
              this_01 = (CNavArea *)piVar3[iVar2 * 2 + 1];
            }
            if ((*(int *)(this_01 + 0x3c) != CNavArea::m_masterMarker) &&
               (fVar8 = (*(float *)(param_4 + 4) - *(float *)(this_01 + 0x30)) *
                        (*(float *)(param_4 + 4) - *(float *)(this_01 + 0x30)) +
                        (*(float *)param_4 - *(float *)(this_01 + 0x2c)) *
                        (*(float *)param_4 - *(float *)(this_01 + 0x2c)) +
                        (*(float *)(param_4 + 8) - *(float *)(this_01 + 0x34)) *
                        (*(float *)(param_4 + 8) - *(float *)(this_01 + 0x34)),
               fVar8 <= param_5 * param_5)) {
              fVar8 = SQRT(fVar8);
              *(float *)(this_01 + 0x40) = fVar8;
              CNavArea::AddToOpenListTail(this_01);
              fVar8 = fVar8 * (param_2 / param_5);
              *(int *)(this_01 + 0x3c) = CNavArea::m_masterMarker;
              if ((0.0 < param_6) &&
                 (lVar7 = (longdouble)CNavArea::GetDanger(this_01,param_1),
                 param_6 < (float)lVar7 + fVar8)) {
                lVar7 = (longdouble)CNavArea::GetDanger(this_01,param_1);
                fVar8 = param_6 - (float)lVar7;
              }
              CNavArea::IncreaseDanger(this_01,param_1,fVar8);
            }
            if (iVar6 + 1 == iVar1) break;
            iVar6 = iVar6 + 1;
            piVar3 = *(int **)(this_00 + iVar4 * 4 + 0x58);
            iVar5 = *piVar3;
          } while( true );
        }
        iVar4 = iVar4 + 1;
      } while (iVar4 != 4);
    }
  }
  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)