L L4D2node

CNavMesh::MergeGeneratedAreas

0x00725030 · 927 bytes · __cdecl

_ZN8CNavMesh19MergeGeneratedAreasEv

Decompiled

undefined (0 params)

/* CNavMesh::MergeGeneratedAreas() */

void CNavMesh::MergeGeneratedAreas(void)

{
  CNavArea *this;
  CNavArea *pCVar1;
  char cVar2;
  int *piVar3;
  int iVar4;
  int local_20;
  
  Msg("Merging navigation areas...\n");
  local_20 = 0;
LAB_00725050:
  do {
    if (DAT_00fe6000 <= local_20) {
      return;
    }
    this = *(CNavArea **)(TheNavAreas + local_20 * 4);
    cVar2 = CNavArea::HasNodes(this);
    if ((cVar2 != '\0') && (((byte)this[0x55] & 0x20) == 0)) {
      piVar3 = *(int **)(this + 0x58);
      if (0 < *piVar3) {
        iVar4 = 0;
        do {
          pCVar1 = (CNavArea *)piVar3[iVar4 * 2 + 1];
          cVar2 = (**(code **)(*(int *)this + 0x74))(this,pCVar1);
          if ((((cVar2 != '\0') &&
               (((*(float *)(pCVar1 + 0x14) - *(float *)(pCVar1 + 8)) + *(float *)(this + 0x14)) -
                *(float *)(this + 8) <= (float)*(int *)(nav_area_max_size._28_4_ + 0x30) * 25.0)) &&
              (*(int *)(this + 0xec) == *(int *)(pCVar1 + 0xf8))) &&
             (((*(int *)(this + 0xf0) == *(int *)(pCVar1 + 0xf4) &&
               (*(int *)(this + 0x54) == *(int *)(pCVar1 + 0x54))) &&
              (cVar2 = CNavArea::IsCoplanar(this,pCVar1), cVar2 != '\0')))) {
            *(undefined4 *)(this + 0xec) = *(undefined4 *)(pCVar1 + 0xec);
            *(undefined4 *)(this + 0xf0) = *(undefined4 *)(pCVar1 + 0xf0);
            CNavArea::FinishMerge(this,pCVar1);
            goto LAB_00725379;
          }
          piVar3 = *(int **)(this + 0x58);
          iVar4 = iVar4 + 1;
        } while (iVar4 < *piVar3);
      }
      piVar3 = *(int **)(this + 0x60);
      if (0 < *piVar3) {
        iVar4 = 0;
        do {
          pCVar1 = (CNavArea *)piVar3[iVar4 * 2 + 1];
          cVar2 = (**(code **)(*(int *)this + 0x74))(this,pCVar1);
          if (((cVar2 != '\0') &&
              (((*(float *)(pCVar1 + 0x14) - *(float *)(pCVar1 + 8)) + *(float *)(this + 0x14)) -
               *(float *)(this + 8) <= (float)*(int *)(nav_area_max_size._28_4_ + 0x30) * 25.0)) &&
             ((*(int *)(pCVar1 + 0xec) == *(int *)(this + 0xf8) &&
              (((*(int *)(pCVar1 + 0xf0) == *(int *)(this + 0xf4) &&
                (*(int *)(this + 0x54) == *(int *)(pCVar1 + 0x54))) &&
               (cVar2 = CNavArea::IsCoplanar(this,pCVar1), cVar2 != '\0')))))) {
            *(undefined4 *)(this + 0xf8) = *(undefined4 *)(pCVar1 + 0xf8);
            *(undefined4 *)(this + 0xf4) = *(undefined4 *)(pCVar1 + 0xf4);
            CNavArea::FinishMerge(this,pCVar1);
            goto LAB_00725379;
          }
          piVar3 = *(int **)(this + 0x60);
          iVar4 = iVar4 + 1;
        } while (iVar4 < *piVar3);
      }
      piVar3 = *(int **)(this + 100);
      if (0 < *piVar3) {
        iVar4 = 0;
        do {
          pCVar1 = (CNavArea *)piVar3[iVar4 * 2 + 1];
          cVar2 = (**(code **)(*(int *)this + 0x74))(this,pCVar1);
          if (((cVar2 != '\0') &&
              (((*(float *)(pCVar1 + 0x10) - *(float *)(pCVar1 + 4)) + *(float *)(this + 0x10)) -
               *(float *)(this + 4) <= (float)*(int *)(nav_area_max_size._28_4_ + 0x30) * 25.0)) &&
             (((*(int *)(this + 0xec) == *(int *)(pCVar1 + 0xf0) &&
               ((*(int *)(this + 0xf8) == *(int *)(pCVar1 + 0xf4) &&
                (*(int *)(this + 0x54) == *(int *)(pCVar1 + 0x54))))) &&
              (cVar2 = CNavArea::IsCoplanar(this,pCVar1), cVar2 != '\0')))) {
            *(undefined4 *)(this + 0xec) = *(undefined4 *)(pCVar1 + 0xec);
            *(undefined4 *)(this + 0xf8) = *(undefined4 *)(pCVar1 + 0xf8);
            CNavArea::FinishMerge(this,pCVar1);
            goto LAB_00725379;
          }
          piVar3 = *(int **)(this + 100);
          iVar4 = iVar4 + 1;
        } while (iVar4 < *piVar3);
      }
      piVar3 = *(int **)(this + 0x5c);
      if (0 < *piVar3) {
        iVar4 = 0;
        while( true ) {
          pCVar1 = (CNavArea *)piVar3[iVar4 * 2 + 1];
          cVar2 = (**(code **)(*(int *)this + 0x74))(this,pCVar1);
          if (((((cVar2 != '\0') &&
                (((*(float *)(pCVar1 + 0x10) - *(float *)(pCVar1 + 4)) + *(float *)(this + 0x10)) -
                 *(float *)(this + 4) <= (float)*(int *)(nav_area_max_size._28_4_ + 0x30) * 25.0))
               && (*(int *)(pCVar1 + 0xec) == *(int *)(this + 0xf0))) &&
              ((*(int *)(pCVar1 + 0xf8) == *(int *)(this + 0xf4) &&
               (*(int *)(this + 0x54) == *(int *)(pCVar1 + 0x54))))) &&
             (cVar2 = CNavArea::IsCoplanar(this,pCVar1), cVar2 != '\0')) break;
          piVar3 = *(int **)(this + 0x5c);
          iVar4 = iVar4 + 1;
          if (*piVar3 <= iVar4) goto LAB_00725258;
        }
        *(undefined4 *)(this + 0xf0) = *(undefined4 *)(pCVar1 + 0xf0);
        *(undefined4 *)(this + 0xf4) = *(undefined4 *)(pCVar1 + 0xf4);
        CNavArea::FinishMerge(this,pCVar1);
LAB_00725379:
        local_20 = 0;
        goto LAB_00725050;
      }
    }
LAB_00725258:
    local_20 = local_20 + 1;
  } while( true );
}

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)