L L4D2node

CNavArea::RaiseCorner

0x00701790 · 1224 bytes · __thiscall

_ZN8CNavArea11RaiseCornerE13NavCornerTypeib

Decompiled

undefined (4 params)

/* CNavArea::RaiseCorner(NavCornerType, int, bool) */

void __thiscall CNavArea::RaiseCorner(CNavArea *this,int param_2,int param_3,char param_4)

{
  int *piVar1;
  int iVar2;
  undefined4 uVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  float fVar10;
  float fVar11;
  float fVar12;
  float fVar13;
  float fVar14;
  int local_48;
  int local_44;
  int local_3c;
  
  while (param_2 == 4) {
    RaiseCorner(this,0,param_3,param_4);
    RaiseCorner(this,1,param_3,param_4);
    RaiseCorner(this,3,param_3,param_4);
    param_2 = 2;
  }
  if (param_2 == 1) {
    *(float *)(this + 0x24) = (float)param_3 + *(float *)(this + 0x24);
  }
  else if (param_2 < 2) {
    if (param_2 == 0) {
      fVar13 = *(float *)(this + 0x18);
      fVar7 = (float)param_3 + *(float *)(this + 0xc);
      *(float *)(this + 0xc) = fVar7;
      goto LAB_0070180e;
    }
  }
  else {
    if (param_2 == 2) {
      fVar7 = *(float *)(this + 0xc);
      fVar13 = (float)param_3 + *(float *)(this + 0x18);
      *(float *)(this + 0x18) = fVar13;
      goto LAB_0070180e;
    }
    if (param_2 == 3) {
      fVar13 = *(float *)(this + 0x18);
      *(float *)(this + 0x28) = (float)param_3 + *(float *)(this + 0x28);
      fVar7 = *(float *)(this + 0xc);
      goto LAB_0070180e;
    }
  }
  fVar7 = *(float *)(this + 0xc);
  fVar13 = *(float *)(this + 0x18);
LAB_0070180e:
  fVar11 = *(float *)(this + 0x10) - *(float *)(this + 4);
  *(float *)(this + 0x34) = (fVar7 + fVar13) * 0.5;
  *(float *)(this + 0x2c) = (*(float *)(this + 0x10) + *(float *)(this + 4)) * 0.5;
  *(float *)(this + 0x30) = (*(float *)(this + 0x14) + *(float *)(this + 8)) * 0.5;
  if ((fVar11 <= 0.0) || (fVar13 = *(float *)(this + 0x14) - *(float *)(this + 8), fVar13 <= 0.0)) {
    *(undefined4 *)(this + 0x20) = 0;
    *(undefined4 *)(this + 0x1c) = 0;
  }
  else {
    *(float *)(this + 0x1c) = 1.0 / fVar11;
    *(float *)(this + 0x20) = 1.0 / fVar13;
  }
  ComputeMinMaxCornerZ(this);
  uVar3 = nav_corner_adjust_adjacent._28_4_;
  if (param_4 != '\0') {
    if (0.0 < *(float *)(nav_corner_adjust_adjacent._28_4_ + 0x2c)) {
      m_masterMarker = m_masterMarker + 1;
      if (m_masterMarker == 0) {
        m_masterMarker = 1;
        *(undefined4 *)(this + 0x3c) = 1;
        fVar13 = *(float *)(uVar3 + 0x2c);
      }
      else {
        *(int *)(this + 0x3c) = m_masterMarker;
        fVar13 = *(float *)(uVar3 + 0x2c);
      }
      if (param_2 == 2) {
        fVar7 = *(float *)(this + 0x10);
        fVar11 = *(float *)(this + 0x14);
        fVar12 = *(float *)(this + 0x18);
      }
      else if (param_2 == 3) {
        fVar7 = *(float *)(this + 4);
        fVar11 = *(float *)(this + 0x14);
        fVar12 = *(float *)(this + 0x28);
      }
      else if (param_2 == 1) {
        fVar7 = *(float *)(this + 0x10);
        fVar11 = *(float *)(this + 8);
        fVar12 = *(float *)(this + 0x24);
      }
      else {
        fVar7 = *(float *)(this + 4);
        fVar11 = *(float *)(this + 8);
        fVar12 = *(float *)(this + 0xc);
      }
      fVar12 = fVar12 - (float)param_3;
      iVar4 = (int)((fVar7 - *(float *)(TheNavMesh + 0x2c)) / *(float *)(TheNavMesh + 0x20));
      if (iVar4 < 0) {
        local_44 = 1;
        local_3c = -1;
      }
      else {
        local_44 = *(int *)(TheNavMesh + 0x24);
        local_3c = local_44 + -2;
        if (iVar4 < local_44) {
          local_44 = iVar4 + 1;
          local_3c = iVar4 + -1;
        }
      }
      iVar4 = (int)((fVar11 - *(float *)(TheNavMesh + 0x30)) / *(float *)(TheNavMesh + 0x20));
      if (iVar4 < 0) {
        local_48 = 0;
      }
      else {
        local_48 = *(int *)(TheNavMesh + 0x28) + -1;
        if (iVar4 < *(int *)(TheNavMesh + 0x28)) {
          local_48 = iVar4;
        }
      }
      if (local_3c <= local_44) {
        do {
          if ((-1 < local_3c) && (local_3c < *(int *)(TheNavMesh + 0x24))) {
            for (iVar4 = local_48 + -1; iVar4 <= local_48 + 1; iVar4 = iVar4 + 1) {
              if (((-1 < iVar4) && (iVar4 < *(int *)(TheNavMesh + 0x28))) &&
                 (piVar1 = (int *)(*(int *)(TheNavMesh + 0xc) +
                                  (*(int *)(TheNavMesh + 0x24) * iVar4 + local_3c) * 0x14),
                 0 < piVar1[3])) {
                iVar6 = 0;
                do {
                  iVar2 = *(int *)(*piVar1 + iVar6 * 4);
                  if (*(int *)(iVar2 + 0x3c) != m_masterMarker) {
                    iVar5 = 0;
                    *(int *)(iVar2 + 0x3c) = m_masterMarker;
                    do {
                      if (iVar5 == 2) {
                        fVar9 = *(float *)(iVar2 + 0x10);
                        fVar8 = *(float *)(iVar2 + 0x14);
                        fVar10 = *(float *)(iVar2 + 0x18);
                      }
                      else if (iVar5 == 3) {
                        fVar10 = *(float *)(iVar2 + 0x28);
                        fVar8 = *(float *)(iVar2 + 0x14);
                        fVar9 = *(float *)(iVar2 + 4);
                      }
                      else if (iVar5 == 1) {
                        fVar10 = *(float *)(iVar2 + 0x24);
                        fVar8 = *(float *)(iVar2 + 8);
                        fVar9 = *(float *)(iVar2 + 0x10);
                      }
                      else {
                        fVar9 = *(float *)(iVar2 + 4);
                        fVar8 = *(float *)(iVar2 + 8);
                        fVar10 = *(float *)(iVar2 + 0xc);
                      }
                      fVar14 = fVar10 - fVar12;
                      if (SQRT((fVar8 - fVar11) * (fVar8 - fVar11) + fVar14 * fVar14 +
                               (fVar9 - fVar7) * (fVar9 - fVar7)) < fVar13) {
                        RaiseCorner((CNavArea *)iVar2,iVar5,
                                    (int)(((float)param_3 + fVar12) - fVar10),0);
                      }
                      iVar5 = iVar5 + 1;
                    } while (iVar5 != 4);
                  }
                  iVar6 = iVar6 + 1;
                } while (iVar6 < piVar1[3]);
              }
            }
          }
          local_3c = local_3c + 1;
        } while (local_3c <= local_44);
      }
      return;
    }
    return;
  }
  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)