L L4D2node

TerrorNavMesh::OnRoundRestart

0x009855a0 · 1012 bytes · __thiscall

_ZN13TerrorNavMesh14OnRoundRestartEv

Decompiled

undefined (1 param)

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

void __thiscall TerrorNavMesh::OnRoundRestart(TerrorNavMesh *this)

{
  uint *puVar1;
  CNavArea *this_00;
  char cVar2;
  int iVar3;
  int iVar4;
  undefined4 local_24;
  undefined4 local_20;
  undefined4 local_18;
  undefined4 local_14;
  int local_10;
  
  local_24 = 0;
  local_20 = 0;
  if (_towlower == 0) {
    local_10 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_24,0,0,0,0,"/data/src/game/server/terror/terrornav.cpp",0xefd,
               &OnRoundRestart()::tm_fmt,"(%s)%s","ZOMBIE","TerrorNavMesh::OnRoundRestart");
    local_10 = _towlower;
  }
  iVar4 = _DAT_0105db00;
  local_18 = local_24;
  local_14 = local_20;
                    /* try { // try from 0098584e to 009858ae has its CatchHandler @ 009859da */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar3 = ThreadGetCurrentId(), iVar4 == iVar3)) {
    if ((char *)*_DAT_0105d15c != "TerrorNavMesh::OnRoundRestart") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd0f443,(char *)0x0,0xc0db47);
    }
    puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
    *puVar1 = *puVar1 | 4;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
                    /* try { // try from 00985656 to 009857ab has its CatchHandler @ 009859b9 */
  CNavMesh::OnRoundRestart();
  if (this[0x4e] == (TerrorNavMesh)0x0) {
    Warning("The nav mesh needs a full nav_analyze\n");
  }
  if (*(float *)(this + 0x6b4) != -1.0) {
    (**(code **)(*(int *)(this + 0x6ac) + 4))(this + 0x6ac,this + 0x6b4);
    *(undefined4 *)(this + 0x6b4) = 0xbf800000;
  }
  if (*(float *)(this + 0x6c0) != -1.0) {
    (**(code **)(*(int *)(this + 0x6b8) + 4))(this + 0x6b8,this + 0x6c0);
    *(undefined4 *)(this + 0x6c0) = 0xbf800000;
  }
  InitializeFlowDistances(this);
  CheckpointRoundRestart(this);
  CollectBoundaryAreas(this);
  if (*(float *)(this + 0x618) != -1.0) {
    (**(code **)(*(int *)(this + 0x610) + 4))(this + 0x610,this + 0x618);
    *(undefined4 *)(this + 0x618) = 0xbf800000;
  }
  if (*(float *)(this + 0x6a8) != -1.0) {
                    /* try { // try from 00985931 to 009859b3 has its CatchHandler @ 009859b9 */
    (**(code **)(*(int *)(this + 0x6a0) + 4))(this + 0x6a0,this + 0x6a8);
    *(undefined4 *)(this + 0x6a8) = 0xbf800000;
  }
  if (*(float *)(this + 0x6cc) != -1.0) {
    (**(code **)(*(int *)(this + 0x6c4) + 4))(this + 0x6c4,this + 0x6cc);
    *(undefined4 *)(this + 0x6cc) = 0xbf800000;
  }
  iVar4 = 0;
  if (0 < DAT_00fe6000) {
    do {
      this_00 = *(CNavArea **)(TheNavAreas + iVar4 * 4);
      if (((byte)this_00[0x12d] & 0x80) != 0) {
                    /* try { // try from 0098581b to 0098581f has its CatchHandler @ 009859b9 */
        CNavArea::MarkAsBlocked(this_00,-1,(CBaseEntity *)0x0,true);
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 < DAT_00fe6000);
  }
  iVar4 = (**(code **)(*gameeventmanager + 0x1c))(gameeventmanager,"round_start_post_nav",0,0);
  if (iVar4 != 0) {
    (**(code **)(*gameeventmanager + 0x20))(gameeventmanager,iVar4,0);
  }
  iVar4 = TheDirector;
  cVar2 = CDirector::IsBackgroundMap();
  if (cVar2 != '\0') {
    iVar4 = *(int *)(ZombieBackgroundLimit._28_4_ + 0x30);
    SpawnBackgroundZombies(iVar4,true);
  }
  iVar3 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar4 = ThreadGetCurrentId(iVar4), iVar3 == iVar4)) {
    cVar2 = CVProfNode::ExitScope();
    if (cVar2 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_10 != 0) {
    (**(code **)(local_10 + 0x54))(local_10,local_18,local_14,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)