L L4D2node

TerrorNavArea::ScriptGetAdjacentArea

0x00977310 · 78 bytes · __thiscall

_ZN13TerrorNavArea21ScriptGetAdjacentAreaEii

Decompiled

undefined (3 params)

/* TerrorNavArea::ScriptGetAdjacentArea(int, int) */

undefined4 __thiscall
TerrorNavArea::ScriptGetAdjacentArea(TerrorNavArea *this,int param_1,int param_2)

{
  int iVar1;
  TerrorNavArea *this_00;
  int iVar2;
  undefined4 uVar3;
  
  if (param_1 < 4) {
    iVar1 = **(int **)(this + param_1 * 4 + 0x58);
    if (0 < iVar1) {
      iVar2 = 0;
      if (param_2 == 0) {
        iVar2 = 0;
      }
      else {
        do {
          iVar2 = iVar2 + 1;
          if (iVar2 == iVar1) {
            return 0;
          }
        } while (param_2 != iVar2);
      }
      this_00 = (TerrorNavArea *)(*(int **)(this + param_1 * 4 + 0x58))[iVar2 * 2 + 1];
      if (this_00 != (TerrorNavArea *)0x0) {
        uVar3 = GetScriptInstance(this_00);
        return uVar3;
      }
    }
  }
  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)