L L4D2node

CNavMesh::GetNearestNavArea

0x0073de20 · 593 bytes · __thiscall

_ZNK8CNavMesh17GetNearestNavAreaEP11CBaseEntityif

Decompiled

undefined (4 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CNavMesh::GetNearestNavArea(CBaseEntity*, int, float) const */

int __thiscall
CNavMesh::GetNearestNavArea(CNavMesh *this,CBaseEntity *param_1,int param_2,float param_3)

{
  char cVar1;
  int iVar2;
  int iVar3;
  int iVar4;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_34 = 0;
  local_30 = 0;
  if (___atan2f_finite == 0) {
    local_20 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_34,0,0,0,0,"/data/src/game/server/nav_mesh.cpp",0x3e5,
               &GetNearestNavArea(CBaseEntity*,int,float)::tm_fmt,"(%s)%s","Unaccounted",
               "CNavMesh::GetNearestNavArea [ent]");
    local_20 = ___atan2f_finite;
  }
  iVar2 = _DAT_0105db00;
  local_28 = local_34;
  local_24 = local_30;
                    /* try { // try from 0073dfa6 to 0073dff4 has its CatchHandler @ 0073e084 */
  if (((_DAT_0105d154 == 0) && (DAT_0105d158 != '\0')) ||
     (iVar4 = ThreadGetCurrentId(), iVar2 != iVar4)) {
    iVar2 = *(int *)(this + 0x18);
  }
  else {
    if ((char *)*_DAT_0105d15c != "CNavMesh::GetNearestNavArea [ent]") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xca6514,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
    iVar2 = *(int *)(this + 0x18);
  }
  if (iVar2 == 0) {
    iVar2 = 0;
  }
  else {
                    /* try { // try from 0073def8 to 0073defc has its CatchHandler @ 0073e099 */
    iVar2 = GetNavArea(this,param_1,param_2,120.0);
    if (iVar2 == 0) {
      if (((byte)param_1[0x14d] & 8) != 0) {
                    /* try { // try from 0073e041 to 0073e07c has its CatchHandler @ 0073e099 */
        CBaseEntity::CalcAbsolutePosition(param_1);
      }
      iVar2 = GetNearestNavArea(this,(Vector *)(param_1 + 0x2e0),false,param_3,
                                (bool)((byte)param_2 & 1),(bool)((byte)((uint)param_2 >> 2) & 1),
                                false);
    }
  }
  iVar4 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar3 = ThreadGetCurrentId(), iVar4 == iVar3)) {
    cVar1 = CVProfNode::ExitScope();
    if (cVar1 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_20 != 0) {
    (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
  }
  return iVar2;
}

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)