L L4D2node

CNavMesh::ScriptGetNavAreasFromBuildPath

0x007415d0 · 600 bytes · __thiscall

_ZN8CNavMesh30ScriptGetNavAreasFromBuildPathEP9HSCRIPT__S1_RK6VectorfibS1_

Decompiled

undefined (8 params)

/* CNavMesh::ScriptGetNavAreasFromBuildPath(HSCRIPT__*, HSCRIPT__*, Vector const&, float, int, bool,
   HSCRIPT__*) */

undefined1 __thiscall
CNavMesh::ScriptGetNavAreasFromBuildPath
          (CNavMesh *this,HSCRIPT__ *param_1,HSCRIPT__ *param_2,Vector *param_3,float param_4,
          int param_5,bool param_6,HSCRIPT__ *param_7)

{
  code *pcVar1;
  undefined1 uVar2;
  bool bVar3;
  ScriptClassDesc_t *pSVar4;
  Vector *pVVar5;
  TerrorNavArea *this_00;
  CNavArea *pCVar6;
  int iVar7;
  int in_GS_OFFSET;
  ShortestPathCost local_13d;
  CNavArea *local_13c;
  void *local_138 [2];
  undefined2 local_130;
  ushort local_12e;
  CFmtStrN<256> local_12c [5];
  undefined1 local_127 [263];
  int local_20;
  
  pCVar6 = (CNavArea *)0x0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (param_1 + -1 < (HSCRIPT__ *)0xfffffffe) {
    pcVar1 = *(code **)(*g_pScriptVM + 0x68);
    pSVar4 = GetScriptDesc<TerrorNavArea>((TerrorNavArea *)0x0);
    pCVar6 = (CNavArea *)(*pcVar1)(g_pScriptVM,param_1,pSVar4);
  }
  this_00 = (TerrorNavArea *)0x0;
  if (param_2 + -1 < (HSCRIPT__ *)0xfffffffe) {
    pcVar1 = *(code **)(*g_pScriptVM + 0x68);
    pSVar4 = GetScriptDesc<TerrorNavArea>((TerrorNavArea *)0x0);
    this_00 = (TerrorNavArea *)(*pcVar1)(g_pScriptVM,param_2,pSVar4);
  }
  if ((*(float *)param_3 == 0.0) && (*(float *)(param_3 + 4) == 0.0)) {
    bVar3 = *(float *)(param_3 + 8) == 0.0;
  }
  else {
    bVar3 = false;
  }
  if ((pCVar6 != (CNavArea *)0x0) &&
     (((!bVar3 || (this_00 != (TerrorNavArea *)0x0)) && (param_7 != (HSCRIPT__ *)0x0)))) {
    pVVar5 = (Vector *)0x0;
    if (!bVar3) {
      pVVar5 = param_3;
    }
    local_13c = (CNavArea *)0x0;
    bVar3 = NavAreaBuildPath<ShortestPathCost>
                      (pCVar6,(CNavArea *)this_00,(Vector *)0x0,pVVar5,&local_13d,&local_13c,param_4
                       ,param_5,param_6);
    if (bVar3) {
      if (this_00 == (TerrorNavArea *)0x0) {
        this_00 = (TerrorNavArea *)local_13c;
      }
      uVar2 = 1;
      if ((this_00 != (TerrorNavArea *)0x0) && (*(int *)(this_00 + 0x78) != 0)) {
        iVar7 = 0;
        do {
          pcVar1 = *(code **)(*g_pScriptVM + 0x78);
          local_138[0] = (void *)TerrorNavArea::GetScriptInstance(this_00);
          local_130 = 0x20;
          local_12e = 0;
                    /* try { // try from 0074179c to 007417c8 has its CatchHandler @ 00741831 */
          CFmtStrN<256>::CFmtStrN(local_12c,"area%i",iVar7);
          (*pcVar1)(g_pScriptVM,param_7,local_127,local_138);
          if ((local_12e & 1) != 0) {
            free(local_138[0]);
          }
          this_00 = *(TerrorNavArea **)(this_00 + 0x78);
        } while ((this_00 != (TerrorNavArea *)0x0) &&
                (iVar7 = iVar7 + 1, *(int *)(this_00 + 0x78) != 0));
      }
      goto LAB_007417ff;
    }
  }
  uVar2 = 0;
LAB_007417ff:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  return uVar2;
}

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)