L L4D2node

CNavMesh::ValidateNavAreaConnections

0x00729090 · 779 bytes · __cdecl

_ZN8CNavMesh26ValidateNavAreaConnectionsEv

Decompiled

undefined (0 params)

/* CNavMesh::ValidateNavAreaConnections() */

void CNavMesh::ValidateNavAreaConnections(void)

{
  int iVar1;
  int *piVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  int *piVar6;
  int iVar7;
  int local_38;
  int local_2c;
  int local_28;
  int local_24;
  int local_20;
  
  local_38 = 0;
  if (0 < DAT_00fe6000) {
    do {
      local_2c = 0;
      iVar1 = *(int *)(TheNavAreas + local_38 * 4);
      local_24 = iVar1;
      do {
        local_20 = 0;
        piVar6 = *(int **)(local_24 + 0x58);
LAB_007290e0:
        local_28 = *piVar6;
        if (local_20 < local_28) {
          do {
            iVar5 = piVar6[local_20 * 2 + 1];
            piVar2 = *(int **)(local_24 + 0x114);
            if (0 < *piVar2) {
              if (iVar5 != piVar2[1]) {
                iVar4 = 0;
                do {
                  iVar4 = iVar4 + 1;
                  if (iVar4 == *piVar2) goto LAB_00729129;
                } while (iVar5 != piVar2[iVar4 * 2 + 1]);
                if (iVar4 == -1) goto LAB_00729129;
              }
              Msg("Area %d has area %d on both 2-way and incoming list, should only be on one\n",
                  *(undefined4 *)(iVar1 + 0x8c),*(undefined4 *)(iVar5 + 0x8c));
              piVar6 = *(int **)(local_24 + 0x58);
              local_28 = *piVar6;
            }
LAB_00729129:
            local_20 = local_20 + 1;
            iVar4 = local_20;
            if (local_20 < local_28) {
              do {
                if (iVar5 == piVar6[iVar4 * 2 + 1]) {
                  Msg("Area %d has multiple outgoing connections to area %d in direction %d\n",
                      *(undefined4 *)(iVar1 + 0x8c),*(undefined4 *)(iVar5 + 0x8c),local_2c);
                  piVar6 = *(int **)(local_24 + 0x58);
                }
                iVar4 = iVar4 + 1;
              } while (iVar4 < *piVar6);
            }
            piVar2 = *(int **)(iVar5 + 0x58 + (&CSWTCH_1514)[local_2c] * 4);
            if (0 < *piVar2) {
              if (iVar1 == piVar2[1]) goto LAB_007290e0;
              iVar4 = 0;
              do {
                iVar4 = iVar4 + 1;
                if (iVar4 == *piVar2) goto LAB_00729191;
              } while (iVar1 != piVar2[iVar4 * 2 + 1]);
              if (iVar4 != -1) goto LAB_007290e0;
            }
LAB_00729191:
            piVar2 = *(int **)(iVar5 + 0x114 + (&CSWTCH_1514)[local_2c] * 4);
            if (0 < *piVar2) {
              if (iVar1 == piVar2[1]) goto LAB_007290e0;
              iVar4 = 0;
              do {
                iVar4 = iVar4 + 1;
                if (iVar4 == *piVar2) goto LAB_007291c1;
              } while (iVar1 != piVar2[iVar4 * 2 + 1]);
              if (iVar4 != -1) goto LAB_007290e0;
            }
LAB_007291c1:
            Msg("Area %d has one-way connect to area %d but does not appear on the latter\'s incoming list\n"
                ,*(undefined4 *)(iVar1 + 0x8c),*(undefined4 *)(iVar5 + 0x8c));
            piVar6 = *(int **)(local_24 + 0x58);
            local_28 = *piVar6;
            if (local_28 <= local_20) break;
          } while( true );
        }
        local_20 = 0;
        piVar6 = *(int **)(local_24 + 0x114);
LAB_00729208:
        iVar5 = *piVar6;
        if (local_20 < iVar5) {
          do {
            iVar4 = local_20 + 1;
            iVar3 = piVar6[local_20 * 2 + 1];
            iVar7 = iVar4;
            if (iVar4 < iVar5) {
              do {
                if (iVar3 == piVar6[iVar7 * 2 + 1]) {
                  Msg("Area %d has multiple incoming connections to area %d in direction %d\n",
                      *(undefined4 *)(iVar1 + 0x8c),*(undefined4 *)(iVar3 + 0x8c),local_2c);
                  piVar6 = *(int **)(local_24 + 0x114);
                }
                iVar7 = iVar7 + 1;
              } while (iVar7 < *piVar6);
            }
            piVar2 = *(int **)(iVar3 + 0x58 + (&CSWTCH_1514)[local_2c] * 4);
            local_20 = iVar4;
            if (0 < *piVar2) {
              if (iVar1 == piVar2[1]) goto LAB_00729208;
              iVar5 = 0;
              do {
                iVar5 = iVar5 + 1;
                if (iVar5 == *piVar2) goto LAB_00729271;
              } while (iVar1 != piVar2[iVar5 * 2 + 1]);
              if (iVar5 != -1) goto LAB_00729208;
            }
LAB_00729271:
            Msg("Area %d has incoming connection from area %d but does not appear on latter\'s outgoing connection list\n"
                ,*(undefined4 *)(iVar1 + 0x8c),*(undefined4 *)(iVar3 + 0x8c));
            piVar6 = *(int **)(local_24 + 0x114);
            iVar5 = *piVar6;
            if (iVar5 <= iVar4) break;
          } while( true );
        }
        local_24 = local_24 + 4;
        local_2c = local_2c + 1;
      } while (local_2c != 4);
      local_38 = local_38 + 1;
    } while (local_38 < DAT_00fe6000);
  }
  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)