L L4D2node

TerrorNavMesh::Update

0x00985ba0 · 1487 bytes · __thiscall

_ZN13TerrorNavMesh6UpdateEv

Decompiled

undefined (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* TerrorNavMesh::Update() */

void __thiscall TerrorNavMesh::Update(TerrorNavMesh *this)

{
  uint *puVar1;
  char cVar2;
  int iVar3;
  char *pcVar4;
  int iVar5;
  CBaseEntity *pCVar6;
  int in_GS_OFFSET;
  longdouble lVar7;
  undefined4 local_b4;
  undefined4 local_b0;
  undefined4 local_ac;
  undefined4 local_a8;
  TerrorNavMesh *local_a4;
  undefined4 local_a0;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_90;
  undefined4 local_8c;
  undefined4 local_88;
  undefined4 local_84;
  undefined4 local_80;
  undefined4 local_7c;
  undefined4 local_78;
  undefined4 local_74;
  char local_70 [80];
  int local_20;
  
  local_b4 = 0;
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  local_b0 = 0;
  if (_towlower == (TerrorNavMesh *)0x0) {
    local_a4 = (TerrorNavMesh *)0x0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_b4,0,0,0,0,"/data/src/game/server/terror/terrornav.cpp",0x109b,
               &Update()::tm_fmt,"(%s)%s","ZOMBIE","TerrorNavMesh::Update");
    local_a4 = _towlower;
  }
  iVar5 = _DAT_0105db00;
  local_ac = local_b4;
  local_a8 = local_b0;
  if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
                    /* try { // try from 00985e56 to 00985eb6 has its CatchHandler @ 009861bc */
    iVar3 = ThreadGetCurrentId();
    if (iVar5 == iVar3) {
      if (*(char **)_DAT_0105d15c != "TerrorNavMesh::Update") {
        _DAT_0105d15c =
             (TerrorNavMesh *)
             CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd0f46d,(char *)0x0,0xc0db47);
      }
      puVar1 = (uint *)(_DAT_0105d1e8 + 4 + *(int *)(_DAT_0105d15c + 0x70) * 8);
      *puVar1 = *puVar1 | 4;
      CVProfNode::EnterScope();
      DAT_0105d158 = '\0';
    }
  }
                    /* try { // try from 00985c7d to 00985dd5 has its CatchHandler @ 00986193 */
  CNavMesh::Update((CNavMesh *)this);
  UpdateCheckpoints(this);
  UpdateBoundarySpread(this);
  if (0.0 < *(float *)(this + 0x6cc)) {
    lVar7 = (longdouble)CountdownTimer::Now();
    if (*(float *)(this + 0x6cc) <= (float)lVar7) {
      if (*(float *)(this + 0x6cc) != -1.0) {
                    /* try { // try from 00985f2c to 0098618d has its CatchHandler @ 00986193 */
        (**(code **)(*(int *)(this + 0x6c4) + 4))(this + 0x6c4,this + 0x6cc);
        *(undefined4 *)(this + 0x6cc) = 0xbf800000;
      }
      RecomputeFlowDistances(this);
    }
  }
  if (*(int *)(ZombieDebug._28_4_ + 0x30) == 0) goto LAB_00985dce;
  cVar2 = CNavMesh::FindActiveNavArea((CNavMesh *)this);
  if (cVar2 == '\0') {
    *(undefined4 *)(this + 0x648) = 0;
LAB_00985cf5:
    iVar5 = *(int *)(ZombieDebugSpawnSet._28_4_ + 0x30);
    if (-1 < iVar5) goto LAB_00985d05;
LAB_0098614b:
    TerrorNavArea::m_masterTerrorMark = TerrorNavArea::m_masterTerrorMark + 1;
    ForEachSurvivor<DrawActiveAreaSet>((DrawActiveAreaSet *)&local_7c);
  }
  else {
    iVar5 = *(int *)(this + 0x474);
    *(int *)(this + 0x648) = iVar5;
    if ((iVar5 == 0) || (*(int *)(ZombieDebug._28_4_ + 0x30) != 1)) goto LAB_00985cf5;
    local_a0 = *(undefined4 *)(iVar5 + 4);
    local_8c = *(undefined4 *)(iVar5 + 0x24);
    local_9c = *(undefined4 *)(iVar5 + 8);
    local_98 = *(undefined4 *)(iVar5 + 0xc);
    local_7c = *(undefined4 *)(iVar5 + 0x10);
    local_90 = *(undefined4 *)(iVar5 + 8);
    local_94 = *(undefined4 *)(iVar5 + 0x10);
    local_80 = *(undefined4 *)(iVar5 + 0x28);
    local_84 = *(undefined4 *)(iVar5 + 0x14);
    local_88 = *(undefined4 *)(iVar5 + 4);
    local_78 = *(undefined4 *)(iVar5 + 0x14);
    local_74 = *(undefined4 *)(iVar5 + 0x18);
    pcVar4 = ", STOP_SCAN";
    if ((*(byte *)(iVar5 + 300) & 4) == 0) {
      pcVar4 = "";
    }
    V_snprintf(local_70,0x50,"ID(%d)%s",*(undefined4 *)(iVar5 + 0x8c),pcVar4);
    NDebugOverlay::Text((Vector *)&local_a0,local_70,false,0.01023);
    NDebugOverlay::Line((Vector *)&local_a0,(Vector *)&local_94,0xff,0xff,0xff,true,0.01023);
    NDebugOverlay::Line((Vector *)&local_a0,(Vector *)&local_88,0xff,0xff,0xff,true,0.01023);
    NDebugOverlay::Line((Vector *)&local_88,(Vector *)&local_7c,0xff,0xff,0xff,true,0.01023);
    NDebugOverlay::Line((Vector *)&local_7c,(Vector *)&local_94,0xff,0xff,0xff,true,0.01023);
    TerrorNavArea::DrawSpawn(*(TerrorNavArea **)(this + 0x648));
    iVar5 = *(int *)(ZombieDebugSpawnSet._28_4_ + 0x30);
    if (iVar5 < 0) goto LAB_0098614b;
LAB_00985d05:
    ZombieManager::CollectSpawnAreas(TheZombieManager,iVar5,9);
    cVar2 = CNavMesh::IsSelectedSetEmpty((CNavMesh *)this);
    if (cVar2 == '\0') {
      if (0 < *(int *)(this + 0x4e0)) {
        iVar5 = 0;
        do {
          TerrorNavArea::DrawSpawn(*(TerrorNavArea **)(*(int *)(this + 0x4d4) + iVar5 * 4));
          iVar5 = iVar5 + 1;
        } while (iVar5 < *(int *)(this + 0x4e0));
      }
    }
    else if (*(TerrorNavArea **)(this + 0x474) != (TerrorNavArea *)0x0) {
      TerrorNavArea::DrawSpawn(*(TerrorNavArea **)(this + 0x474));
    }
  }
  pCVar6 = (CBaseEntity *)0x0;
  while( true ) {
    pCVar6 = (CBaseEntity *)
             CGlobalEntityList::FindEntityByClassname
                       ((CGlobalEntityList *)gEntList,pCVar6,"func_elevator");
    if (pCVar6 == (CBaseEntity *)0x0) break;
    NDebugOverlay::VertArrow
              ((Vector *)(pCVar6 + 0x454),(Vector *)(pCVar6 + 0x460),10.0,0xff,0,0,0xff,true,0.01023
              );
  }
LAB_00985dce:
  ProcessBreakables(this);
  iVar5 = _DAT_0105db00;
  if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
    iVar3 = ThreadGetCurrentId();
    if (iVar5 == iVar3) {
      this = _DAT_0105d15c;
      cVar2 = CVProfNode::ExitScope();
      if (cVar2 != '\0') {
        _DAT_0105d15c = *(TerrorNavMesh **)(_DAT_0105d15c + 100);
      }
      DAT_0105d158 = _DAT_0105d15c == (TerrorNavMesh *)0x105d160;
    }
  }
  if (local_a4 != (TerrorNavMesh *)0x0) {
    this = local_a4;
    (**(code **)(local_a4 + 0x54))(local_a4,local_ac,local_a8,0,0,0);
  }
  if (local_20 == *(int *)(in_GS_OFFSET + 0x14)) {
    return;
  }
                    /* WARNING: Subroutine does not return */
  __stack_chk_fail(this);
}

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)