L L4D2node

CNavMesh::TestFilesWritable

0x0071b810 · 511 bytes · __thiscall

_ZN8CNavMesh17TestFilesWritableEv

Decompiled

undefined (1 param)

/* CNavMesh::TestFilesWritable() */

uint __thiscall CNavMesh::TestFilesWritable(CNavMesh *this)

{
  char cVar1;
  char *pcVar2;
  int iVar3;
  char *pcVar4;
  uint uVar5;
  int in_GS_OFFSET;
  char acStack_128 [4];
  char local_124 [260];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  uVar5 = (uint)(byte)this[9];
  if (this[9] == (CNavMesh)0x0) {
    pcVar2 = (char *)GetFilename();
    if (pcVar2 == (char *)0x0) {
      Warning("Couldn\'t test if nav file was writable, file name pointer is null!");
    }
    else {
      cVar1 = *pcVar2;
      pcVar4 = pcVar2;
      while (cVar1 != '\0') {
        while (cVar1 != '\\') {
          pcVar4 = pcVar4 + 1;
          cVar1 = *pcVar4;
          if (cVar1 == '\0') goto LAB_0071b88b;
        }
        *pcVar4 = '/';
        pcVar4 = pcVar4 + 1;
        cVar1 = *pcVar4;
      }
LAB_0071b88b:
      iVar3 = _V_strlen(pcVar2);
      if (iVar3 < 5) {
        Warning("Couldn\'t test if nav file was writable, file name too short!");
      }
      else {
        _V_strcpy(local_124,pcVar2);
        _V_strcpy(acStack_128 + iVar3,"_nav.txt");
        cVar1 = (**(code **)(*(int *)(filesystem + 4) + 0x28))(filesystem + 4,pcVar2,0);
        if ((cVar1 == '\0') ||
           (uVar5 = (**(code **)(*(int *)(filesystem + 4) + 0x2c))(filesystem + 4,pcVar2,0),
           (char)uVar5 != '\0')) {
          cVar1 = (**(code **)(*(int *)(filesystem + 4) + 0x28))(filesystem + 4,local_124,0);
          if ((cVar1 == '\0') ||
             (uVar5 = (**(code **)(*(int *)(filesystem + 4) + 0x2c))(filesystem + 4,local_124,0),
             (char)uVar5 != '\0')) {
            this[9] = (CNavMesh)0x1;
            uVar5 = 1;
            goto LAB_0071b832;
          }
          Warning("*******************************************\n");
          Warning("*******************************************\n");
          pcVar2 = "** ERROR: _NAV.TXT FILE NOT WRITABLE!!!  **\n";
        }
        else {
          Warning("*******************************************\n");
          Warning("*******************************************\n");
          pcVar2 = "** ERROR: .NAV FILE NOT WRITABLE!!!      **\n";
        }
        Warning(pcVar2);
        Warning("** YOU MUST CHECK IT OUT FROM PERFORCE!  **\n");
        Warning("*******************************************\n");
        Warning("*******************************************\n");
      }
    }
  }
LAB_0071b832:
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return uVar5;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail();
}

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)