L L4D2node

CNavMesh::GetNavArea

0x0073bb80 · 778 bytes · __thiscall

_ZNK8CNavMesh10GetNavAreaERK6Vectorf

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CNavMesh::GetNavArea(Vector const&, float) const */

CNavArea * __thiscall CNavMesh::GetNavArea(CNavMesh *this,Vector *param_1,float param_2)

{
  int *piVar1;
  float fVar2;
  CNavArea *this_00;
  char cVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  int iVar7;
  longdouble lVar8;
  CNavArea *local_48;
  float local_44;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  undefined4 local_30;
  int local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  local_3c = 0;
  local_38 = 0;
  if (___atan2f_finite == 0) {
    local_2c = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_3c,0,0,0,0,"/data/src/game/server/nav_mesh.cpp",0x26b,
               &GetNavArea(Vector_const&,float)::tm_fmt,"(%s)%s","Unaccounted",
               "CNavMesh::GetNavArea");
    local_2c = ___atan2f_finite;
  }
  iVar6 = _DAT_0105db00;
  local_34 = local_3c;
  local_30 = local_38;
                    /* try { // try from 0073bdd6 to 0073be24 has its CatchHandler @ 0073bea3 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar4 = ThreadGetCurrentId(), iVar6 == iVar4)) {
    if ((char *)*_DAT_0105d15c != "CNavMesh::GetNavArea") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xca59d9,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  if (*(int *)(this + 0x18) != 0) {
    iVar6 = *(int *)(this + 0x24);
    local_28 = *(float *)param_1;
    iVar4 = (int)((local_28 - *(float *)(this + 0x2c)) / *(float *)(this + 0x20));
    if (iVar4 < 0) {
      iVar4 = 0;
    }
    else if (iVar6 <= iVar4) {
      iVar4 = iVar6 + -1;
    }
    local_24 = *(float *)(param_1 + 4);
    iVar5 = 0;
    iVar7 = (int)((local_24 - *(float *)(this + 0x30)) / *(float *)(this + 0x20));
    if (-1 < iVar7) {
      if (iVar7 < *(int *)(this + 0x28)) {
        iVar5 = iVar7 * iVar6;
      }
      else {
        iVar5 = (*(int *)(this + 0x28) + -1) * iVar6;
      }
    }
    piVar1 = (int *)(*(int *)(this + 0xc) + (iVar4 + iVar5) * 0x14);
    local_20 = *(float *)(param_1 + 8) + 5.0;
    if (0 < piVar1[3]) {
      iVar6 = 0;
      local_48 = (CNavArea *)0x0;
      local_44 = -1e+08;
      do {
        while( true ) {
          this_00 = *(CNavArea **)(*piVar1 + iVar6 * 4);
                    /* try { // try from 0073bd0f to 0073bd35 has its CatchHandler @ 0073beb8 */
          cVar3 = CNavArea::IsOverlapping(this_00,(Vector *)&local_28,0.0);
          if (cVar3 != '\0') break;
LAB_0073bcf0:
          iVar6 = iVar6 + 1;
          if (piVar1[3] <= iVar6) goto LAB_0073bd73;
        }
        lVar8 = (longdouble)CNavArea::GetZ(this_00,local_28,local_24);
        fVar2 = (float)lVar8;
        if (((local_20 < fVar2) || (fVar2 < *(float *)(param_1 + 8) - param_2)) ||
           (fVar2 < local_44)) goto LAB_0073bcf0;
        iVar6 = iVar6 + 1;
        local_48 = this_00;
        local_44 = fVar2;
      } while (iVar6 < piVar1[3]);
      goto LAB_0073bd73;
    }
  }
  local_48 = (CNavArea *)0x0;
LAB_0073bd73:
  iVar6 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar4 = ThreadGetCurrentId(), iVar6 == iVar4)) {
    cVar3 = CVProfNode::ExitScope();
    if (cVar3 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_2c != 0) {
    (**(code **)(local_2c + 0x54))(local_2c,local_34,local_30,0,0,0);
  }
  return local_48;
}

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)