L L4D2node

CNavArea::UpdateAvoidanceObstacles

0x00703c30 · 629 bytes · __thiscall

_ZN8CNavArea24UpdateAvoidanceObstaclesEv

Decompiled

undefined (1 param)

/* CNavArea::UpdateAvoidanceObstacles() */

void __thiscall CNavArea::UpdateAvoidanceObstacles(CNavArea *this)

{
  float fVar1;
  char cVar2;
  int iVar3;
  int *piVar4;
  int iVar5;
  longdouble lVar6;
  float fVar7;
  float local_50;
  undefined4 local_4c;
  undefined4 local_48;
  float local_44;
  undefined4 local_40;
  undefined4 local_3c;
  float local_38;
  Vector local_34 [12];
  Vector local_28 [24];
  
  lVar6 = (longdouble)CountdownTimer::Now();
  if ((float)lVar6 < *(float *)(this + 0xb0)) {
    return;
  }
  fVar7 = 1.0;
  if ((0.0 < *(float *)(this + 0xa0)) && (fVar7 = *(float *)(this + 0x9c) + 1.0, 5.0 <= fVar7)) {
    fVar7 = 5.0;
  }
  lVar6 = (longdouble)CountdownTimer::Now();
  if ((float)lVar6 + fVar7 == *(float *)(this + 0xb0)) {
    fVar1 = *(float *)(this + 0xac);
  }
  else {
    (**(code **)(*(int *)(this + 0xa8) + 4))(this + 0xa8,this + 0xb0);
    fVar1 = *(float *)(this + 0xac);
    *(float *)(this + 0xb0) = (float)lVar6 + fVar7;
  }
  if (fVar7 != fVar1) {
    (**(code **)(*(int *)(this + 0xa8) + 4))(this + 0xa8,this + 0xac);
    *(float *)(this + 0xac) = fVar7;
  }
  local_4c = *(undefined4 *)(this + 4);
  fVar7 = *(float *)(this + 0x18);
  local_38 = *(float *)(this + 0xc);
  local_48 = *(undefined4 *)(this + 8);
  local_44 = fVar7;
  if (local_38 <= fVar7) {
    local_44 = local_38;
  }
  local_40 = *(undefined4 *)(this + 0x10);
  local_3c = *(undefined4 *)(this + 0x14);
  if (local_38 <= fVar7) {
    local_38 = fVar7;
  }
  local_38 = local_38 + 55.0;
  if (0 < TheNavMesh[0x16a]) {
    iVar5 = 0;
    local_50 = 0.0;
    do {
      while( true ) {
        piVar4 = *(int **)(TheNavMesh[0x167] + iVar5 * 4);
        iVar3 = (**(code **)(*piVar4 + 0xc))(piVar4);
        if (iVar3 != 0) break;
LAB_00703d28:
        iVar5 = iVar5 + 1;
        if (TheNavMesh[0x16a] <= iVar5) goto LAB_00703dd0;
      }
      (**(code **)(*(int *)(iVar3 + 0x194) + 0x3c))(iVar3 + 0x194,local_34,local_28);
      cVar2 = IsBoxIntersectingBox((Vector *)&local_4c,(Vector *)&local_40,local_34,local_28);
      if ((cVar2 == '\0') || (cVar2 = (**(code **)(*piVar4 + 8))(piVar4), cVar2 == '\0'))
      goto LAB_00703d28;
      iVar5 = iVar5 + 1;
      lVar6 = (longdouble)(**(code **)(*piVar4 + 4))(piVar4);
      fVar7 = (float)lVar6;
      if ((float)lVar6 <= local_50) {
        fVar7 = local_50;
      }
      local_50 = fVar7;
    } while (iVar5 < TheNavMesh[0x16a]);
LAB_00703dd0:
    piVar4 = TheNavMesh;
    if (0.0 < local_50) {
      if (255.0 <= local_50) {
        this[0x3a] = (CNavArea)0xff;
        return;
      }
      iVar5 = (int)local_50;
      if ((float)iVar5 < local_50) {
        iVar5 = iVar5 + 1;
      }
      this[0x3a] = SUB41(iVar5,0);
      if (SUB41(iVar5,0) != (CNavArea)0x0) {
        return;
      }
      goto LAB_00703e08;
    }
  }
  piVar4 = TheNavMesh;
  this[0x3a] = (CNavArea)0x0;
LAB_00703e08:
  (**(code **)(*piVar4 + 0x68))(piVar4,this);
  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)