L L4D2node

TerrorNavArea::PostLoad

0x00994880 · 432 bytes · __thiscall

_ZN13TerrorNavArea8PostLoadEv

Decompiled

undefined (1 param)

/* TerrorNavArea::PostLoad() */

undefined4 __thiscall TerrorNavArea::PostLoad(TerrorNavArea *this)

{
  undefined2 *puVar1;
  undefined2 uVar2;
  ushort *puVar3;
  size_t __nmemb;
  char cVar4;
  undefined4 uVar5;
  int iVar6;
  int iVar7;
  undefined2 *puVar8;
  int iVar9;
  int iVar10;
  int local_20;
  
  CNavArea::PostLoad((CNavArea *)this);
  uVar5 = CNavMesh::GetNavAreaByID(TheNavMesh,*(uint *)(this + 0x130));
  iVar9 = *(int *)(this + 0x13c);
  *(undefined4 *)(this + 0x130) = uVar5;
  while (0 < iVar9) {
    puVar3 = *(ushort **)(this + 0x134);
    iVar6 = 0;
    if (TheNavAreas[(int)(uint)*puVar3 >> 2] != *TheNavAreas) {
      do {
        iVar6 = iVar6 + 1;
        if (iVar6 == iVar9) goto LAB_00994903;
      } while (*TheNavAreas != TheNavAreas[(int)(uint)puVar3[iVar6] >> 2]);
      if (iVar6 == -1) break;
    }
    iVar10 = (iVar9 - iVar6) + -1;
    if (0 < iVar10) {
      _V_memmove(puVar3 + iVar6,puVar3 + iVar6 + 1,iVar10 * 2);
      iVar9 = *(int *)(this + 0x13c);
    }
    iVar9 = iVar9 + -1;
    *(int *)(this + 0x13c) = iVar9;
  }
LAB_00994903:
  cVar4 = CDirector::AllowSurvivorRescue(TheDirector);
  if (cVar4 == '\0') {
    RemoveSpawnAttributes(this,0x10000);
  }
  __nmemb = *(size_t *)(this + 0x13c);
  if (1 < (int)__nmemb) {
    if (*(void **)(this + 0x134) == (void *)0x0) {
      local_20 = __nmemb - 1;
      do {
        if (0 < local_20) {
          iVar6 = 0;
          iVar9 = 1;
          do {
            while( true ) {
              iVar10 = iVar9 * 2;
              iVar7 = AreaSortFunc((AreaBindInfo *)(*(int *)(this + 0x134) + iVar6),
                                   (AreaBindInfo *)(*(int *)(this + 0x134) + iVar10));
              if (-1 < iVar7) break;
              iVar9 = iVar9 + 1;
              puVar1 = (undefined2 *)(*(int *)(this + 0x134) + iVar10);
              puVar8 = (undefined2 *)(*(int *)(this + 0x134) + iVar6);
              iVar6 = iVar6 + 2;
              uVar2 = *puVar8;
              *puVar8 = *puVar1;
              *puVar1 = uVar2;
              if (local_20 < iVar9) goto LAB_00994a31;
            }
            iVar9 = iVar9 + 1;
            iVar6 = iVar6 + 2;
          } while (iVar9 <= local_20);
        }
LAB_00994a31:
        local_20 = local_20 + -1;
        if (local_20 == -1) {
          return 0;
        }
      } while( true );
    }
    qsort(*(void **)(this + 0x134),__nmemb,2,AreaSortFunc);
  }
  return 0;
}

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)