L L4D2node

CNavArea::UpdateBlocked

0x00703360 · 1553 bytes · __thiscall

_ZN8CNavArea13UpdateBlockedEbi

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* CNavArea::UpdateBlocked(bool, int) */

void __thiscall CNavArea::UpdateBlocked(CNavArea *this,bool param_1,int param_2)

{
  CNavArea CVar1;
  char cVar2;
  CNavArea *pCVar3;
  int iVar4;
  int *piVar5;
  int iVar6;
  CNavArea CVar7;
  uint uVar8;
  uint uVar9;
  int in_GS_OFFSET;
  bool bVar10;
  longdouble lVar11;
  float fVar12;
  float local_44;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_30;
  undefined4 local_2c;
  CNavArea *local_28;
  Color local_24;
  undefined1 local_23;
  undefined1 local_22;
  undefined1 local_21;
  int local_20;
  
  local_3c = 0;
  local_38 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  if (___atan2f_finite == (CNavArea *)0x0) {
    local_28 = (CNavArea *)0x0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_3c,0,0,0,0,"/data/src/game/server/nav_area.cpp",0x136a,
               &UpdateBlocked(bool,int)::tm_fmt,"(%s)%s","Unaccounted","CNavArea::UpdateBlocked");
    local_28 = ___atan2f_finite;
  }
  iVar4 = _DAT_0105db00;
  local_30 = local_3c;
  local_2c = local_38;
                    /* try { // try from 0070365e to 007036ac has its CatchHandler @ 007039e5 */
  if (((_DAT_0105d154 == 0) && (DAT_0105d158 != '\0')) ||
     (iVar6 = ThreadGetCurrentId(), iVar4 != iVar6)) {
    if (!param_1) goto LAB_007036c4;
LAB_00703434:
    fVar12 = *(float *)(this + 0xa0);
  }
  else {
    if (*(char **)_DAT_0105d15c != "CNavArea::UpdateBlocked") {
      _DAT_0105d15c =
           (CNavArea *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xca139c,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
    if (param_1) goto LAB_00703434;
LAB_007036c4:
    pCVar3 = this + 0x98;
                    /* try { // try from 007036c7 to 007036cb has its CatchHandler @ 007039c4 */
    lVar11 = (longdouble)CountdownTimer::Now();
    iVar4 = _DAT_0105db00;
    fVar12 = *(float *)(this + 0xa0);
    if ((float)lVar11 < fVar12) {
      if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
         (iVar6 = ThreadGetCurrentId(pCVar3), iVar4 == iVar6)) {
        pCVar3 = _DAT_0105d15c;
        cVar2 = CVProfNode::ExitScope();
        if (cVar2 != '\0') {
          _DAT_0105d15c = *(CNavArea **)(_DAT_0105d15c + 100);
        }
        DAT_0105d158 = _DAT_0105d15c == (CNavArea *)0x105d160;
      }
      if (local_28 != (CNavArea *)0x0) {
        pCVar3 = local_28;
        (**(code **)(local_28 + 0x54))(local_28,local_30,local_2c,0,0,0);
      }
      goto LAB_0070363b;
    }
  }
  if (fVar12 <= 0.0) {
    local_44 = 1.0;
  }
  else {
    local_44 = *(float *)(this + 0x9c) + 1.0;
    if (5.0 <= local_44) {
      local_44 = 5.0;
    }
  }
                    /* try { // try from 00703469 to 007035e1 has its CatchHandler @ 007039c4 */
  lVar11 = (longdouble)CountdownTimer::Now();
  if ((float)lVar11 + local_44 != *(float *)(this + 0xa0)) {
    (**(code **)(*(int *)(this + 0x98) + 4))(this + 0x98,this + 0xa0);
    *(float *)(this + 0xa0) = (float)lVar11 + local_44;
  }
  if (local_44 != *(float *)(this + 0x9c)) {
                    /* try { // try from 00703763 to 0070385d has its CatchHandler @ 007039c4 */
    (**(code **)(*(int *)(this + 0x98) + 4))(this + 0x98,this + 0x9c);
    *(float *)(this + 0x9c) = local_44;
  }
  CVar1 = this[0x7f];
  uVar9 = 0;
  if ((int)*(uint *)(this + 0x54) < 0) {
    uVar9 = *(uint *)(this + 0x54) >> 0x1b & 1;
    CVar7 = CVar1;
    if (param_1) {
      UpdateBlockedFromNavBlockers(this);
      if (-1 < *(int *)(this + 0x54)) goto LAB_007034b9;
      CVar7 = this[0x7f];
    }
    cVar2 = IsBlocked(this,2,false);
    if ((cVar2 == '\0') || (cVar2 = IsBlocked(this,3,false), cVar2 == '\0')) {
      bVar10 = true;
      if (CVar7 == (CNavArea)0x0) goto LAB_007034b9;
      goto LAB_007034bb;
    }
  }
  else {
LAB_007034b9:
    bVar10 = false;
LAB_007034bb:
    UpdateBlockedFromTrace(this,param_1,param_2,bVar10);
    CVar7 = this[0x7f];
  }
  bVar10 = CVar7 != (CNavArea)0x0;
  if (((bVar10) && (CVar1 != (CNavArea)0x0)) &&
     ((((byte)CVar7 & 1) != ((byte)CVar1 & 1) || (((byte)CVar7 >> 1 & 1) != ((byte)CVar1 >> 1 & 1)))
     )) {
    Warning("UpdateBlocked: Area %d is already blocked with a different team id! This may cause flow bugs.\n"
            ,*(undefined4 *)(this + 0x8c));
  }
  pCVar3 = (CNavArea *)&DAT_00d539c2;
  if (*(CNavArea **)(gpGlobals + 0x3c) != (CNavArea *)0x0) {
    pCVar3 = *(CNavArea **)(gpGlobals + 0x3c);
  }
  iVar4 = V_strncmp((char *)pCVar3,"c8",2);
  if (iVar4 == 0) {
    uVar9 = 1;
  }
  if ((CVar1 != (CNavArea)0x0) != bVar10) {
    piVar5 = (int *)(**(code **)(*gameeventmanager + 0x1c))
                              (gameeventmanager,"nav_blocked",0,&g_NavBlockedEvent);
    if (piVar5 != (int *)0x0) {
      (**(code **)(*piVar5 + 0x30))(piVar5,"area",*(undefined4 *)(this + 0x8c));
      (**(code **)(*piVar5 + 0x30))(piVar5,"blocked",bVar10);
      (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,piVar5,0);
    }
    if (bVar10) {
      if (*(int *)(nav_debug_blocked._28_4_ + 0x30) != 0) {
        local_24 = 0;
        local_23 = 0xff;
        local_22 = 0x80;
        local_21 = 0xff;
                    /* try { // try from 00703940 to 00703977 has its CatchHandler @ 007039c4 */
        ConColorMsg(&local_24,"area %d is blocked\n",*(undefined4 *)(this + 0x8c));
      }
      uVar8 = uVar9;
      if (((int)*(uint *)(this + 0x54) < 0) &&
         (uVar8 = 1, (*(uint *)(this + 0x54) & 0x8000000) == 0)) {
        uVar8 = uVar9;
      }
      pCVar3 = TheNavMesh;
      (**(code **)(*(int *)TheNavMesh + 0x5c))(TheNavMesh,this,uVar8);
    }
    else {
      if (*(int *)(nav_debug_blocked._28_4_ + 0x30) != 0) {
        local_24 = 0;
        local_23 = 0x80;
        local_22 = 0xff;
        local_21 = 0xff;
        ConColorMsg(&local_24,"area %d is unblocked\n",*(undefined4 *)(this + 0x8c));
      }
      pCVar3 = TheNavMesh;
      (**(code **)(*(int *)TheNavMesh + 0x60))(TheNavMesh,this,uVar9);
    }
  }
  iVar4 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar6 = ThreadGetCurrentId(), iVar4 == iVar6)) {
    pCVar3 = _DAT_0105d15c;
    cVar2 = CVProfNode::ExitScope();
    if (cVar2 != '\0') {
      _DAT_0105d15c = *(CNavArea **)(_DAT_0105d15c + 100);
    }
    DAT_0105d158 = _DAT_0105d15c == (CNavArea *)0x105d160;
  }
  if (local_28 != (CNavArea *)0x0) {
    pCVar3 = local_28;
    (**(code **)(local_28 + 0x54))(local_28,local_30,local_2c,0,0,0);
  }
LAB_0070363b:
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail(pCVar3);
  }
  return;
}

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)