L L4D2node

EscapeScan::operator()

0x00a78c00 · 1176 bytes · __thiscall

_ZN10EscapeScanclEP8CNavArea

Decompiled

undefined (2 params)

/* EscapeScan::TEMPNAMEPLACEHOLDERVALUE(CNavArea*) */

undefined4 __thiscall EscapeScan::operator()(EscapeScan *this,CNavArea *param_1)

{
  Vector *pVVar1;
  float fVar2;
  float fVar3;
  float fVar4;
  CNavArea *this_00;
  char cVar5;
  CNavArea *pCVar6;
  CBaseEntity *pCVar7;
  int *piVar8;
  CBaseEntity *pCVar9;
  uint uVar10;
  int *piVar11;
  int iVar12;
  int iVar13;
  longdouble lVar14;
  float fVar15;
  float fVar16;
  float fVar17;
  float fVar18;
  float local_4c;
  int local_44;
  float local_20 [4];
  
  this_00 = *(CNavArea **)(param_1 + 0x78);
  if ((*(int *)(ZombieDebugEscapeScan._28_4_ + 0x30) != 0) && (this_00 != (CNavArea *)0x0)) {
    NDebugOverlay::HorzArrow
              ((Vector *)(this_00 + 0x2c),(Vector *)(param_1 + 0x2c),2.0,0xff,0xff,0,0xff,true,
               99999.9);
  }
  pCVar6 = (CNavArea *)(**(code **)(**(int **)this + 0x52c))(*(int **)this);
  if (param_1 != pCVar6) {
    iVar12 = 0;
    iVar13 = 0;
    do {
      iVar13 = (iVar13 + 1) -
               (uint)(((int)(uint)(byte)param_1[0x7d] >> ((byte)iVar12 & 0x1f) & 1U) == 0);
      iVar12 = iVar12 + 1;
    } while (iVar12 != 4);
    if (iVar13 <= *(int *)(this + 8)) {
      pVVar1 = (Vector *)(param_1 + 0x2c);
      pCVar7 = (CBaseEntity *)
               CDirectorTacticalServices::GetClosestSurvivor
                         (*(CDirectorTacticalServices **)(TheDirector + 0x628),pVVar1,true,true);
      fVar15 = 0.0;
      if (pCVar7 != (CBaseEntity *)0x0) {
        if (((byte)pCVar7[0x14d] & 8) != 0) {
          CBaseEntity::CalcAbsolutePosition(pCVar7);
        }
        fVar15 = (*(float *)(pCVar7 + 0x2e4) - *(float *)(param_1 + 0x30)) *
                 (*(float *)(pCVar7 + 0x2e4) - *(float *)(param_1 + 0x30)) +
                 (*(float *)(pCVar7 + 0x2e0) - *(float *)(param_1 + 0x2c)) *
                 (*(float *)(pCVar7 + 0x2e0) - *(float *)(param_1 + 0x2c)) +
                 (*(float *)(pCVar7 + 0x2e8) - *(float *)(param_1 + 0x34)) *
                 (*(float *)(pCVar7 + 0x2e8) - *(float *)(param_1 + 0x34));
      }
      if (iVar13 == *(int *)(this + 8)) {
        if (*(float *)(this + 0xc) <= fVar15 && fVar15 != *(float *)(this + 0xc)) {
          piVar11 = (int *)(**(code **)(*(int *)(*(int *)this + 0x4028) + 0xcc))
                                     (*(int *)this + 0x4028);
          cVar5 = (**(code **)(*piVar11 + 0xf4))(piVar11,pVVar1);
          if (cVar5 != '\0') {
            *(CNavArea **)(this + 4) = param_1;
            *(float *)(this + 0xc) = fVar15;
          }
        }
      }
      else {
        piVar11 = (int *)0x0;
        if (*(int *)this != 0) {
          piVar11 = (int *)(*(int *)this + 0x4028);
        }
        piVar8 = (int *)(**(code **)(*piVar11 + 0xc0))(piVar11);
        pCVar7 = (CBaseEntity *)(**(code **)(*piVar11 + 0xb4))(piVar11);
        iVar12 = (**(code **)(*(int *)pCVar7 + 0x14c))(pCVar7);
        if (iVar12 == 0) {
          local_4c = 1.0;
        }
        else {
          local_4c = *(float *)(iVar12 + 0x1cec);
        }
        cVar5 = (**(code **)(*(int *)pCVar7 + 0x16c))(pCVar7);
        pCVar9 = (CBaseEntity *)0x0;
        if (cVar5 != '\0') {
          pCVar9 = pCVar7;
        }
        iVar12 = CBaseEntity::GetTeamNumber(pCVar7);
        local_44 = 9;
        if (iVar12 == 3) {
          local_44 = (**(code **)(*(int *)pCVar7 + 0x544))(pCVar7);
        }
        cVar5 = (**(code **)(*piVar8 + 0x150))(piVar8,param_1);
        if (cVar5 != '\0') {
          fVar17 = *(float *)(param_1 + 4);
          fVar2 = *(float *)(param_1 + 0x10);
          fVar3 = *(float *)(param_1 + 8);
          fVar4 = *(float *)(param_1 + 0x14);
          if (this_00 != (CNavArea *)0x0) {
            lVar14 = (longdouble)CNavArea::GetZDeltaAtEdgeToArea(this_00,param_1);
            fVar16 = (float)lVar14;
            lVar14 = (longdouble)(**(code **)(*piVar8 + 0x134))(piVar8);
            if ((float)lVar14 < fVar16) {
              return 1;
            }
            if (local_44 == 1) {
              if (fVar16 < 0.0) {
                fVar16 = fVar16 + fVar16;
              }
              else if (0.0 <= fVar16) {
                fVar16 = 0.0;
              }
            }
            else {
              if (fVar16 <= 0.0) {
                fVar16 = 0.0;
              }
              fVar18 = 1.0;
              if (24.0 <= fVar16) {
                fVar18 = (1.0 - local_4c) * 3.0 + 1.0;
              }
              fVar16 = fVar16 * fVar18;
            }
            if (3.0 < ABS(fVar16)) {
              local_20[0] = ABS(fVar16) + 1.0;
            }
            else {
              local_20[0] = 1.0;
            }
            if (pCVar9 == (CBaseEntity *)0x0) {
              uVar10 = *(uint *)(param_1 + 0x54);
            }
            else {
              (**(code **)(InfectedPathCost::
                           operator()(CNavArea*,CNavArea*,CNavLadder_const*,CFuncElevator_const*,float)
                           ::hideDesire + local_44 * 4))(local_20,param_1);
              uVar10 = *(uint *)(param_1 + 0x54);
              if ((uVar10 & 1) != 0) {
                return 1;
              }
            }
            fVar16 = local_20[0];
            if ((uVar10 & 0x80000) != 0) {
              fVar16 = local_20[0] * 10.0;
            }
            fVar16 = fVar16 + *(float *)(this_00 + 0x44);
            if ((param_1[0x39] != (CNavArea)0x0) &&
               (fVar17 = (((fVar4 + fVar2) - fVar3) - fVar17) * 0.5, 1.0 <= fVar17)) {
              fVar16 = fVar16 + ((float)(byte)param_1[0x39] * 50000.0) / fVar17;
            }
            if (fVar16 < 0.0) {
              return 1;
            }
          }
          piVar11 = (int *)(**(code **)(*(int *)(*(int *)this + 0x4028) + 0xcc))
                                     (*(int *)this + 0x4028);
          cVar5 = (**(code **)(*piVar11 + 0xf4))(piVar11,pVVar1);
          if (cVar5 != '\0') {
            *(CNavArea **)(this + 4) = param_1;
            *(int *)(this + 8) = iVar13;
            *(float *)(this + 0xc) = fVar15;
          }
        }
      }
    }
  }
  return 1;
}

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)