L L4D2node

CNavMesh::Update

0x007400b0 · 1674 bytes · __thiscall

_ZN8CNavMesh6UpdateEv

Decompiled

undefined (1 param)

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

void __thiscall CNavMesh::Update(CNavMesh *this)

{
  char cVar1;
  int iVar2;
  int iVar3;
  CNavMesh *pCVar4;
  int local_70;
  undefined4 local_64;
  undefined4 local_60;
  undefined4 local_58;
  undefined4 local_54;
  int local_50;
  float local_4c;
  float local_48;
  float local_44;
  float local_40;
  float local_3c;
  float local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  local_64 = 0;
  local_60 = 0;
  if (___atan2f_finite == 0) {
    local_50 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_64,0,0,0,0,"/data/src/game/server/nav_mesh.cpp",0xf3,
               &Update()::tm_fmt,"(%s)%s","Unaccounted","CNavMesh::Update");
    local_50 = ___atan2f_finite;
  }
  iVar3 = _DAT_0105db00;
  local_58 = local_64;
  local_54 = local_60;
                    /* try { // try from 007401e6 to 00740234 has its CatchHandler @ 00740776 */
  if (((_DAT_0105d154 == 0) && (DAT_0105d158 != '\0')) ||
     (iVar2 = ThreadGetCurrentId(), iVar3 != iVar2)) {
    iVar3 = *(int *)(this + 0x528);
  }
  else {
    if ((char *)*_DAT_0105d15c != "CNavMesh::Update") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xca5af4,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
    iVar3 = *(int *)(this + 0x528);
  }
  if (iVar3 == 0) {
                    /* try { // try from 00740253 to 007405fd has its CatchHandler @ 00740755 */
    UpdateBlockedAreas(this);
    pCVar4 = this;
    UpdateAvoidanceObstacleAreas(this);
    if (*(int *)(nav_edit._28_4_ + 0x30) == 0) {
      if (this[0x45c] != (CNavMesh)0x0) {
        pCVar4 = this;
                    /* try { // try from 00740680 to 00740684 has its CatchHandler @ 00740755 */
        OnEditModeEnd();
        this[0x45c] = (CNavMesh)0x0;
      }
    }
    else {
      if (this[0x45c] == (CNavMesh)0x0) {
        OnEditModeStart(this);
        this[0x45c] = (CNavMesh)0x1;
      }
      pCVar4 = this;
      DrawEditMode(this);
    }
    if (*(int *)(nav_show_danger._28_4_ + 0x30) != 0) {
      pCVar4 = this;
      DrawDanger();
    }
    if (*(int *)(nav_show_player_counts._28_4_ + 0x30) != 0) {
      pCVar4 = this;
                    /* try { // try from 00740739 to 0074074d has its CatchHandler @ 00740755 */
      DrawPlayerCounts();
    }
    if (0 < *(int *)(this + 0x564)) {
      local_70 = 0;
      iVar3 = 0;
      do {
        iVar2 = *(int *)(this + 0x558);
        local_34 = *(float *)(iVar2 + iVar3);
        local_30 = *(float *)(iVar2 + 4 + iVar3);
        local_2c = *(float *)(iVar2 + 8 + iVar3);
        local_28 = *(float *)(iVar2 + 0xc + iVar3);
        local_24 = *(float *)(iVar2 + 0x10 + iVar3);
        local_20 = *(float *)(iVar2 + 0x14 + iVar3);
        local_40 = local_28 * 50.0 + local_34;
        local_3c = local_24 * 50.0 + local_30;
        local_38 = local_20 * 50.0 + local_2c;
        NDebugOverlay::Line((Vector *)&local_34,(Vector *)&local_40,0xff,0,0xff,true,0.1);
        local_40 = local_28 * 50.0 + local_34;
        local_4c = local_34 + 25.0;
        local_3c = local_24 * 50.0 + local_30;
        local_48 = local_30;
        local_38 = local_20 * 50.0 + local_2c;
        local_44 = local_2c;
        NDebugOverlay::Line((Vector *)&local_4c,(Vector *)&local_40,0xff,0,0xff,true,0.1);
        local_40 = local_28 * 50.0 + local_34;
        local_4c = local_34 - 25.0;
        local_3c = local_24 * 50.0 + local_30;
        local_48 = local_30;
        local_38 = local_20 * 50.0 + local_2c;
        local_44 = local_2c;
        NDebugOverlay::Line((Vector *)&local_4c,(Vector *)&local_40,0xff,0,0xff,true,0.1);
        local_40 = local_28 * 50.0 + local_34;
        local_4c = local_34;
        local_3c = local_24 * 50.0 + local_30;
        local_48 = local_30 + 25.0;
        local_38 = local_20 * 50.0 + local_2c;
        local_44 = local_2c;
        NDebugOverlay::Line((Vector *)&local_4c,(Vector *)&local_40,0xff,0,0xff,true,0.1);
        local_40 = local_28 * 50.0 + local_34;
        local_4c = local_34;
        local_3c = local_24 * 50.0 + local_30;
        local_48 = local_30 - 25.0;
        local_38 = local_20 * 50.0 + local_2c;
        local_44 = local_2c;
        pCVar4 = (CNavMesh *)&local_4c;
        NDebugOverlay::Line((Vector *)&local_4c,(Vector *)&local_40,0xff,0,0xff,true,0.1);
        local_70 = local_70 + 1;
        iVar3 = iVar3 + 0x18;
      } while (local_70 < *(int *)(this + 0x564));
    }
    iVar3 = _DAT_0105db00;
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar2 = ThreadGetCurrentId(pCVar4), iVar3 == iVar2)) {
      cVar1 = CVProfNode::ExitScope();
      if (cVar1 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
    if (local_50 != 0) {
      (**(code **)(local_50 + 0x54))(local_50,local_58,local_54,0,0,0);
      return;
    }
  }
  else {
                    /* try { // try from 00740180 to 00740184 has its CatchHandler @ 00740755 */
    UpdateGeneration(this,0.03);
    iVar3 = _DAT_0105db00;
    if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
       (iVar2 = ThreadGetCurrentId(), iVar3 == iVar2)) {
      cVar1 = CVProfNode::ExitScope();
      if (cVar1 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
    if (local_50 != 0) {
      (**(code **)(local_50 + 0x54))(local_50,local_58,local_54,0,0,0);
    }
  }
  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)