L L4D2node

CNavArea::Draw

0x007000b0 · 5645 bytes · __thiscall

_ZNK8CNavArea4DrawEv

Decompiled

undefined (1 param)

/* WARNING: Type propagation algorithm not settling */
/* CNavArea::Draw() const */

void __thiscall CNavArea::Draw(CNavArea *this)

{
  bool bVar1;
  char cVar2;
  CNavArea *pCVar3;
  char *pcVar4;
  int iVar5;
  uint uVar6;
  undefined4 uVar7;
  Vector *pVVar8;
  Vector *pVVar9;
  byte bVar10;
  int iVar11;
  longdouble lVar12;
  float fVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  float fVar17;
  float fVar18;
  float *local_f0;
  float *local_e0;
  float local_c4;
  float *local_c0;
  float local_b0;
  float local_ac;
  float local_a8;
  float local_a4;
  float local_a0;
  float local_9c;
  float local_98;
  float local_94;
  float local_90;
  float local_8c;
  float local_88;
  float local_84;
  float local_80;
  float local_7c;
  float local_78;
  float local_74;
  float local_70;
  float local_6c;
  float local_68;
  float local_64;
  float local_60;
  float local_5c [3];
  int local_50;
  float local_4c;
  float local_48;
  float local_44;
  undefined1 local_40 [12];
  undefined1 local_34 [12];
  undefined1 local_28 [24];
  
  if (*(int *)(TheNavMesh + 0x458) == 1) {
    bVar1 = false;
    bVar10 = 4;
    if (*(int *)(this + 0x94) != 0) {
      bVar10 = (*(int *)(this + 0x94) != *(int *)(TheNavMesh + 0x460)) + 2;
    }
  }
  else {
    pCVar3 = (CNavArea *)CNavMesh::GetMarkedArea(TheNavMesh);
    if (this == pCVar3) {
      bVar1 = false;
      bVar10 = 6;
    }
    else {
      bVar1 = true;
      bVar10 = (this != *(CNavArea **)(TheNavMesh + 0x474)) * '\x02' + 5;
    }
  }
  local_b0 = *(float *)(this + 4);
  local_a4 = *(float *)(this + 0x10);
  if (local_b0 < local_a4) {
    local_ac = *(float *)(this + 8);
    local_94 = *(float *)(this + 0x14);
    if (local_ac < local_94) goto LAB_007001c8;
  }
  if ((Draw()::blink == '\0') && (iVar5 = __cxa_guard_acquire(&Draw()::blink), iVar5 != 0)) {
    Draw()::blink._0_4_ = &PTR_NetworkStateChanged_00c23e10;
    Draw()::blink._4_4_ = -1.0;
    __cxa_guard_release(&Draw()::blink);
  }
  if ((Draw()::blink._4_4_ <= 0.0) ||
     (lVar12 = (longdouble)IntervalTimer::Now(), 1.0 < (float)lVar12 - Draw()::blink._4_4_)) {
    lVar12 = (longdouble)IntervalTimer::Now();
    if ((float)lVar12 != Draw()::blink._4_4_) {
      Draw()::blink._4_4_ = (float)lVar12;
    }
    Draw()::blinkOn = Draw()::blinkOn ^ 1;
  }
  bVar10 = Draw()::blinkOn ^ 1;
  pcVar4 = (char *)UTIL_VarArgs("Degenerate area %d",*(undefined4 *)(this + 0x8c));
  NDebugOverlay::Text((Vector *)(this + 0x2c),pcVar4,true,0.01023);
  local_b0 = *(float *)(this + 4);
  bVar1 = false;
  local_ac = *(float *)(this + 8);
  local_a4 = *(float *)(this + 0x10);
  local_94 = *(float *)(this + 0x14);
LAB_007001c8:
  local_a8 = *(float *)(this + 0xc);
  local_9c = *(float *)(this + 0x24);
  local_84 = *(float *)(this + 0x18);
  local_90 = *(float *)(this + 0x28);
  local_a0 = local_ac;
  local_98 = local_b0;
  local_8c = local_a4;
  local_88 = local_94;
  if (*(int *)(nav_show_light_intensity._28_4_ + 0x30) != 0) {
    iVar11 = 1;
    iVar5 = 0;
    while (iVar5 != 3) {
      if (iVar5 == 1) {
        local_5c[1] = *(float *)(this + 8);
        local_5c[2] = *(float *)(this + 0x24);
        local_5c[0] = *(float *)(this + 0x10);
        goto LAB_0070033b;
      }
      local_5c[1] = *(float *)(this + 8);
      local_5c[2] = *(float *)(this + 0xc);
      local_5c[0] = *(float *)(this + 4);
      local_4c = local_5c[0];
      local_48 = local_5c[1];
      local_44 = local_5c[2];
      lVar12 = (longdouble)GetLightIntensity(this,(Vector *)local_5c);
      fVar16 = (float)lVar12 * 255.0;
      local_44 = (float)lVar12 * 71.0 + local_44;
      iVar5 = (int)fVar16;
      if (fVar16 <= 192.0) {
        fVar16 = 192.0;
      }
      NDebugOverlay::Line((Vector *)&local_4c,(Vector *)local_5c,iVar5,iVar5,(int)fVar16,true,
                          0.01023);
      iVar5 = iVar11;
      if (iVar11 == 4) goto LAB_007003d0;
      while (iVar11 = iVar5 + 1, iVar5 == 2) {
        local_5c[0] = *(float *)(this + 0x10);
        local_5c[1] = *(float *)(this + 0x14);
        local_5c[2] = *(float *)(this + 0x18);
LAB_0070033b:
        local_4c = local_5c[0];
        local_48 = local_5c[1];
        local_44 = local_5c[2];
        lVar12 = (longdouble)GetLightIntensity(this,(Vector *)local_5c);
        fVar16 = (float)lVar12 * 255.0;
        local_44 = (float)lVar12 * 71.0 + local_44;
        iVar5 = (int)fVar16;
        if (fVar16 <= 192.0) {
          fVar16 = 192.0;
        }
        NDebugOverlay::Line((Vector *)&local_4c,(Vector *)local_5c,iVar5,iVar5,(int)fVar16,true,
                            0.01023);
        iVar5 = iVar11;
      }
    }
    local_5c[0] = *(float *)(this + 4);
    local_5c[1] = *(float *)(this + 0x14);
    local_5c[2] = *(float *)(this + 0x28);
    local_4c = local_5c[0];
    local_48 = local_5c[1];
    local_44 = local_5c[2];
    lVar12 = (longdouble)GetLightIntensity(this,(Vector *)local_5c);
    local_44 = (float)lVar12 * 71.0 + local_44;
    fVar15 = (float)lVar12 * 255.0;
    fVar16 = 192.0;
    if (192.0 <= fVar15) {
      fVar16 = fVar15;
    }
    NDebugOverlay::Line((Vector *)&local_4c,(Vector *)local_5c,(int)fVar15,(int)fVar15,(int)fVar16,
                        true,0.01023);
  }
LAB_007003d0:
  pcVar4 = "FCVAR_NEVER_AS_STRING";
  if ((nav_area_bgcolor[0x15] & 0x10) == 0) {
    pcVar4 = "";
    if (*(char **)(nav_area_bgcolor._28_4_ + 0x24) != (char *)0x0) {
      pcVar4 = *(char **)(nav_area_bgcolor._28_4_ + 0x24);
    }
  }
  iVar5 = sscanf(pcVar4,"%d %d %d %d",(Vector *)local_5c,local_5c + 1,local_5c + 2,&local_50);
  if (iVar5 == 4) {
    pVVar8 = (Vector *)local_5c;
    do {
      iVar5 = 0;
      if (-1 < *(int *)pVVar8) {
        iVar5 = *(int *)pVVar8;
      }
      if (0xff < iVar5) {
        iVar5 = 0xff;
      }
      pVVar9 = pVVar8 + 4;
      *(int *)pVVar8 = iVar5;
      pVVar8 = pVVar9;
    } while (pVVar9 != (Vector *)&local_4c);
    if (0 < local_50) {
      local_4c = local_a4;
      local_48 = local_a0;
      local_44 = local_9c + 0.8;
      local_68 = local_8c;
      local_64 = local_88;
      local_60 = local_84 + 0.8;
      local_74 = local_b0;
      local_70 = local_ac;
      local_6c = local_a8 + 0.8;
      NDebugOverlay::Triangle
                ((Vector *)&local_74,(Vector *)&local_68,pVVar9,(int)local_5c[0],(int)local_5c[1],
                 (int)local_5c[2],local_50,true,0.01023);
      local_4c = local_98;
      local_48 = local_94;
      local_44 = local_90 + 0.8;
      local_68 = local_b0;
      local_64 = local_ac;
      local_60 = local_a8 + 0.8;
      local_6c = local_84 + 0.8;
      local_74 = local_8c;
      local_70 = local_88;
      NDebugOverlay::Triangle
                ((Vector *)&local_74,(Vector *)&local_68,pVVar9,(int)local_5c[0],(int)local_5c[1],
                 (int)local_5c[2],local_50,true,0.01023);
    }
  }
  local_b0 = local_b0 + 0.2;
  local_ac = local_ac + 0.2;
  local_a4 = local_a4 - 0.2;
  local_a0 = local_a0 + 0.2;
  local_98 = local_98 + 0.2;
  local_94 = local_94 - 0.2;
  local_8c = local_8c - 0.2;
  local_88 = local_88 - 0.2;
  if (((byte)this[0x55] & 1) == 0) {
    NavDrawLine(&local_b0,&local_a4,bVar10);
    NavDrawLine(&local_a4,&local_8c,bVar10);
    NavDrawLine(&local_8c,&local_98,bVar10);
    NavDrawLine(&local_98,&local_b0,bVar10);
  }
  else {
    NavDrawDashedLine();
    NavDrawDashedLine(&local_a4,&local_8c,bVar10);
    NavDrawDashedLine(&local_8c,&local_98,bVar10);
    NavDrawDashedLine(&local_98,&local_b0,bVar10);
  }
  local_e0 = &local_8c;
  local_f0 = &local_98;
  pCVar3 = (CNavArea *)CNavMesh::GetMarkedArea(TheNavMesh);
  if ((this == pCVar3) && (*(int *)(TheNavMesh + 0x47c) != 4)) {
    GetCornerHotspot(this,*(int *)(TheNavMesh + 0x47c),&local_4c);
    NavDrawLine(local_40,local_34,6);
    NavDrawLine(local_34,local_28,6);
  }
  pCVar3 = (CNavArea *)CNavMesh::GetMarkedArea(TheNavMesh);
  if (((this != pCVar3) && (this == *(CNavArea **)(TheNavMesh + 0x474))) &&
     (*(int *)(TheNavMesh + 0x458) == 0)) {
    uVar7 = GetCornerUnderCursor(this);
    cVar2 = GetCornerHotspot(this,uVar7,&local_4c);
    if (cVar2 != '\0') {
      NavDrawLine(local_40,local_34,5);
      NavDrawLine(local_34,local_28,5);
    }
  }
  uVar6 = *(uint *)(this + 0x54);
  if ((uVar6 & 1) != 0) {
    if (bVar1) {
      bVar10 = 0x18;
    }
    NavDrawLine(&local_b0,local_e0,bVar10);
    uVar6 = *(uint *)(this + 0x54);
  }
  if ((uVar6 & 2) != 0) {
    if (bVar1) {
      bVar10 = 0x19;
    }
    if ((uVar6 & 1) == 0) {
      NavDrawLine(&local_b0,local_e0,bVar10);
    }
    NavDrawLine(&local_a4,local_f0,bVar10);
    uVar6 = *(uint *)(this + 0x54);
  }
  if ((uVar6 & 4) != 0) {
    local_78 = *(float *)(this + 0x34);
    if (bVar1) {
      bVar10 = 0x1a;
    }
    local_7c = *(float *)(this + 0x30) - 8.0;
    local_80 = *(float *)(this + 0x2c);
    local_70 = *(float *)(this + 0x30) + 8.0;
    local_74 = local_80;
    local_6c = local_78;
    NavDrawLine(&local_80,&local_74,bVar10);
    local_60 = *(float *)(this + 0x34);
    local_68 = *(float *)(this + 0x2c) - 8.0;
    local_64 = *(float *)(this + 0x30);
    local_4c = *(float *)(this + 0x2c) + 8.0;
    local_48 = local_64;
    local_44 = local_60;
    NavDrawLine(&local_68,&local_4c,bVar10);
    uVar6 = *(uint *)(this + 0x54);
  }
  if ((uVar6 & 8) != 0) {
    local_64 = *(float *)(this + 0x30);
    local_7c = local_64 - 8.0;
    local_80 = *(float *)(this + 0x2c);
    local_78 = *(float *)(this + 0x34);
    if (bVar1) {
      bVar10 = 0x1b;
    }
    local_70 = local_64 + 8.0;
    local_68 = local_80 - 8.0;
    local_4c = local_80 + 8.0;
    local_74 = local_80;
    local_6c = local_78;
    local_60 = local_78;
    local_48 = local_64;
    local_44 = local_78;
    NavDrawLine(&local_80,&local_4c,bVar10);
    NavDrawLine(&local_4c,&local_74,bVar10);
    NavDrawLine(&local_74,&local_68,bVar10);
    NavDrawLine(&local_68,&local_80,bVar10);
    uVar6 = *(uint *)(this + 0x54);
  }
  if ((uVar6 & 0x1000) != 0) {
    fVar16 = *(float *)(this + 0x10);
    if (bVar1) {
      bVar10 = 0x20;
    }
    fVar15 = *(float *)(this + 8);
    fVar17 = *(float *)(this + 4);
    fVar14 = *(float *)(this + 0x14);
    if (ABS(((*(float *)(this + 0x28) + *(float *)(this + 0xc)) -
            (*(float *)(this + 0x24) + *(float *)(this + 0x18))) * 0.5) <=
        ABS(((*(float *)(this + 0xc) + *(float *)(this + 0x24)) -
            (*(float *)(this + 0x18) + *(float *)(this + 0x28))) * 0.5)) {
      fVar13 = fVar14 - fVar15;
      fVar18 = 0.0;
      local_c4 = fVar17;
      while( true ) {
        local_c0 = &local_4c;
        fVar15 = (fVar14 - fVar15) * fVar18 + fVar15;
        lVar12 = (longdouble)GetZ(this,fVar16,fVar15);
        local_44 = (float)lVar12;
        local_4c = fVar16;
        local_48 = fVar15;
        lVar12 = (longdouble)GetZ(this,local_c4,fVar15);
        local_60 = (float)lVar12;
        local_68 = local_c4;
        local_64 = fVar15;
        NavDrawLine(&local_68,local_c0,bVar10);
        fVar18 = fVar18 + 9.0 / fVar13;
        if (1.0 < fVar18) break;
        local_c4 = *(float *)(this + 4);
        fVar15 = *(float *)(this + 8);
        fVar14 = *(float *)(this + 0x14);
        fVar16 = *(float *)(this + 0x10);
      }
    }
    else {
      fVar13 = fVar16 - fVar17;
      fVar18 = 0.0;
      local_c4 = fVar15;
      while( true ) {
        fVar17 = (fVar16 - fVar17) * fVar18 + fVar17;
        lVar12 = (longdouble)GetZ(this,fVar17,fVar14);
        local_44 = (float)lVar12;
        local_4c = fVar17;
        local_48 = fVar14;
        lVar12 = (longdouble)GetZ(this,fVar17,local_c4);
        local_60 = (float)lVar12;
        local_64 = local_c4;
        local_68 = fVar17;
        NavDrawLine(&local_68,&local_4c,bVar10);
        fVar18 = fVar18 + 9.0 / fVar13;
        if (1.0 < fVar18) break;
        local_c4 = *(float *)(this + 8);
        fVar17 = *(float *)(this + 4);
        fVar16 = *(float *)(this + 0x10);
        fVar14 = *(float *)(this + 0x14);
      }
    }
    uVar6 = *(uint *)(this + 0x54);
  }
  if ((uVar6 & 0x10) != 0) {
    local_48 = *(float *)(this + 0x30) + 3.2;
    if (bVar1) {
      bVar10 = 0x1c;
    }
    local_68 = *(float *)(this + 0x2c) + 8.0;
    local_64 = *(float *)(this + 0x30) - 3.2;
    local_60 = *(float *)(this + 0x34);
    local_4c = local_68;
    local_44 = local_60;
    NavDrawLine(&local_68,&local_4c,bVar10);
    local_68 = *(float *)(this + 0x2c) + 8.0;
    local_60 = *(float *)(this + 0x34);
    local_4c = *(float *)(this + 0x2c) + 3.2;
    local_64 = *(float *)(this + 0x30) + 3.2;
    local_48 = *(float *)(this + 0x30) + 8.0;
    local_44 = local_60;
    NavDrawLine(&local_68,&local_4c,bVar10);
    local_48 = *(float *)(this + 0x30) + 3.2;
    local_68 = *(float *)(this + 0x2c) - 8.0;
    local_64 = *(float *)(this + 0x30) - 3.2;
    local_60 = *(float *)(this + 0x34);
    local_4c = local_68;
    local_44 = local_60;
    NavDrawLine(&local_68,&local_4c,bVar10);
    local_4c = *(float *)(this + 0x2c) - 3.2;
    local_68 = *(float *)(this + 0x2c) - 8.0;
    local_60 = *(float *)(this + 0x34);
    local_64 = *(float *)(this + 0x30) + 3.2;
    local_48 = *(float *)(this + 0x30) + 8.0;
    local_44 = local_60;
    NavDrawLine(&local_68,&local_4c,bVar10);
    local_4c = *(float *)(this + 0x2c) + 3.2;
    local_64 = *(float *)(this + 0x30) + 8.0;
    local_68 = *(float *)(this + 0x2c) - 3.2;
    local_60 = *(float *)(this + 0x34);
    local_48 = local_64;
    local_44 = local_60;
    NavDrawLine(&local_68,&local_4c,bVar10);
    local_4c = *(float *)(this + 0x2c) - 3.2;
    local_68 = *(float *)(this + 0x2c) - 8.0;
    local_60 = *(float *)(this + 0x34);
    local_48 = *(float *)(this + 0x30) - 8.0;
    local_64 = *(float *)(this + 0x30) - 3.2;
    local_44 = local_60;
    NavDrawLine(&local_68,&local_4c,bVar10);
    local_4c = *(float *)(this + 0x2c) + 3.2;
    local_64 = *(float *)(this + 0x30) - 8.0;
    local_68 = *(float *)(this + 0x2c) - 3.2;
    local_60 = *(float *)(this + 0x34);
    local_48 = local_64;
    local_44 = local_60;
    NavDrawLine(&local_68,&local_4c,bVar10);
    local_68 = *(float *)(this + 0x2c) + 3.2;
    local_60 = *(float *)(this + 0x34);
    local_4c = *(float *)(this + 0x2c) + 8.0;
    local_48 = *(float *)(this + 0x30) - 3.2;
    local_64 = *(float *)(this + 0x30) - 8.0;
    local_44 = local_60;
    NavDrawLine(&local_68,&local_4c,bVar10);
    uVar6 = *(uint *)(this + 0x54);
  }
  if ((uVar6 & 0x40) != 0) {
    local_4c = *(float *)(this + 0x2c) + 8.0;
    local_64 = *(float *)(this + 0x30);
    local_68 = *(float *)(this + 0x2c) - 8.0;
    if (bVar1) {
      bVar10 = 0x1e;
    }
    local_60 = *(float *)(this + 0x34);
    local_48 = local_64;
    local_44 = local_60;
    NavDrawHorizontalArrow(&local_68,&local_4c,0x40800000,bVar10);
    uVar6 = *(uint *)(this + 0x54);
  }
  if ((uVar6 & 0x20) != 0) {
    local_4c = *(float *)(this + 0x2c) + 8.0;
    local_68 = *(float *)(this + 0x2c) - 8.0;
    local_60 = *(float *)(this + 0x34);
    if (bVar1) {
      bVar10 = 0x1d;
    }
    local_64 = *(float *)(this + 0x30) + 4.0;
    local_48 = local_64;
    local_44 = local_60;
    NavDrawHorizontalArrow(&local_68,&local_4c,0x40800000,bVar10);
    local_4c = *(float *)(this + 0x2c) + 8.0;
    local_68 = *(float *)(this + 0x2c) - 8.0;
    local_60 = *(float *)(this + 0x34);
    local_64 = *(float *)(this + 0x30) - 4.0;
    local_48 = local_64;
    local_44 = local_60;
    NavDrawHorizontalArrow(&local_68,&local_4c,0x40800000,bVar10);
    uVar6 = *(uint *)(this + 0x54);
  }
  if ((uVar6 & 0x80) != 0) {
    local_60 = *(float *)(this + 0x34);
    local_4c = *(float *)(this + 0x2c) + 3.0;
    if (bVar1) {
      bVar10 = 0x1f;
    }
    local_68 = *(float *)(this + 0x2c) - 3.0;
    local_64 = *(float *)(this + 0x30) + 8.0;
    local_48 = local_64;
    local_44 = local_60;
    NavDrawTriangle(this + 0x2c,&local_68,&local_4c,bVar10);
    local_74 = *(float *)(this + 0x2c);
    local_4c = local_74 + 2.0;
    local_68 = local_74 - 2.0;
    local_64 = *(float *)(this + 0x30) - 6.0;
    local_70 = *(float *)(this + 0x30) - 3.0;
    local_6c = *(float *)(this + 0x34);
    local_60 = local_6c;
    local_48 = local_64;
    local_44 = local_6c;
    NavDrawTriangle(&local_74,&local_68,&local_4c,bVar10);
  }
  if (this[0x7f] == (CNavArea)0x0) {
    if ((this[0x3a] == (CNavArea)0x0) || ((float)(byte)this[0x3a] + 0.0 <= 18.0)) {
      if (*(int *)(this + 0x70) < *(int *)(gpGlobals + 0x18)) {
        return;
      }
      iVar5 = 9;
    }
    else {
      iVar5 = 9;
    }
  }
  else {
    iVar5 = ~(*(int *)(this + 0x54) >> 0x1f) + 10;
  }
  local_b0 = local_b0 + 4.0;
  local_ac = local_ac + 4.0;
  local_a4 = local_a4 - 4.0;
  local_a0 = local_a0 + 4.0;
  local_98 = local_98 + 4.0;
  local_94 = local_94 - 4.0;
  local_8c = local_8c - 4.0;
  local_88 = local_88 - 4.0;
  NavDrawLine(&local_b0,&local_a4,iVar5);
  NavDrawLine(&local_a4,local_e0,iVar5);
  NavDrawLine(local_e0,local_f0,iVar5);
  NavDrawLine(local_f0,&local_b0,iVar5);
  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)