L L4D2node

InfectedFlee::Update

0x00a33700 · 2415 bytes · __thiscall

_ZN12InfectedFlee6UpdateEP8Infectedf

Decompiled

undefined (3 params)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* InfectedFlee::Update(Infected*, float) */

void __thiscall InfectedFlee::Update(InfectedFlee *this,Infected *param_1,float param_2)

{
  uint *puVar1;
  CNavArea CVar2;
  char cVar3;
  bool bVar4;
  int *piVar5;
  int iVar6;
  CEscapeRoute *pCVar7;
  Vector *pVVar8;
  Path *this_00;
  int iVar9;
  Vector *pVVar10;
  CNavArea *pCVar11;
  CNavArea *pCVar12;
  CBaseEntity *pCVar13;
  int iVar14;
  INextBot *pIVar15;
  Infected *pIVar16;
  undefined4 uVar17;
  longdouble lVar18;
  float fVar19;
  float fVar20;
  float fVar21;
  PathFollower *local_80;
  CNavArea *local_70;
  undefined4 local_6c;
  undefined4 local_68;
  undefined **local_60;
  float local_5c;
  undefined4 local_58;
  undefined4 local_54;
  undefined4 local_50;
  int local_4c;
  float local_48;
  float local_44;
  float local_40;
  undefined4 local_3c;
  undefined4 local_38;
  undefined4 local_34;
  float local_30 [8];
  
  iVar6 = *(int *)(param_1 + 0x4814);
  if (iVar6 == 0) {
LAB_00a33880:
    iVar6 = TheEscapeRoute();
    if (iVar6 == 0) {
      iVar6 = *(int *)(param_1 + 0x4814);
    }
    else {
      lVar18 = (longdouble)Infected::GetFlowDistance((Infected *)param_2);
      fVar19 = (float)lVar18;
      lVar18 = (longdouble)RandomFloat(0x44bb8000,0x453b8000);
      local_30[0] = -9999.0;
      fVar20 = (float)lVar18;
      local_30[1] = 2.8026e-45;
      local_30[2] = 0.0;
      local_30[3] = 1.4013e-45;
      local_30[4] = 0.0;
      ForEachSurvivor<AverageFlowDistance>((AverageFlowDistance *)local_30);
      iVar6 = TheEscapeRoute();
      fVar21 = fVar19 / *(float *)(iVar6 + 0x1c44);
      if ((fVar21 <= 0.1) || ((fVar21 <= 0.9 && (local_30[0] <= fVar19)))) {
        uVar17 = 1;
      }
      else {
        uVar17 = 0;
        fVar20 = -fVar20;
      }
      pCVar7 = (CEscapeRoute *)TheEscapeRoute();
      iVar6 = CEscapeRoute::GetAreaFromFlow(pCVar7,fVar19 + fVar20,uVar17);
      if (iVar6 == 0) {
        iVar6 = *(int *)(param_1 + 0x4814);
      }
      else {
        local_60 = &PTR_operator___00d24088;
        local_5c = param_2;
        local_58 = (**(code **)(*(int *)param_2 + 0x590))(param_2);
        local_6c = 0;
        pVVar8 = (Vector *)(iVar6 + 0x2c);
        local_68 = 0;
        pIVar15 = (INextBot *)((int)param_2 + 0x1a3c);
        this_00 = (Path *)(param_1 + 0x34);
        if (_towlower == 0) {
          local_4c = 0;
        }
        else {
          (**(code **)(_towlower + 0x50))
                    (_towlower,&local_6c,0,0,0,0,"/data/src/game/server/nextbot/path/nextbotpath.h",
                     0x113,&Path::
                            Compute<InfectedFleePathCost>(INextBot*,Vector_const&,InfectedFleePathCost&,float)
                            ::tm_fmt,"(%s)%s","NextBotSpiky","Path::Compute(goal)");
          local_4c = _towlower;
        }
        iVar14 = _DAT_0105db00;
        local_54 = local_6c;
        local_50 = local_68;
                    /* try { // try from 00a33a29 to 00a33a2d has its CatchHandler @ 00a340c2 */
        if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
           (iVar9 = ThreadGetCurrentId(), iVar14 == iVar9)) {
          if ((char *)*_DAT_0105d15c != "Path::Compute(goal)") {
                    /* try { // try from 00a33ff4 to 00a34017 has its CatchHandler @ 00a340c2 */
            _DAT_0105d15c =
                 (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xbfa1b7,(char *)0x0,0xbfa1cb);
          }
          puVar1 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
          *puVar1 = *puVar1 | 4;
          CVProfNode::EnterScope();
          DAT_0105d158 = '\0';
        }
                    /* try { // try from 00a33a45 to 00a33bcd has its CatchHandler @ 00a340a1 */
        (**(code **)(*(int *)(param_1 + 0x34) + 0x48))(this_00);
        pVVar10 = (Vector *)(**(code **)(*(int *)((int)param_2 + 0x1a3c) + 0xd4))(pIVar15);
        piVar5 = (int *)(**(code **)(*(int *)((int)param_2 + 0x1a3c) + 0xb4))(pIVar15);
        pCVar11 = (CNavArea *)(**(code **)(*piVar5 + 0x52c))(piVar5);
        if (pCVar11 == (CNavArea *)0x0) {
                    /* try { // try from 00a34071 to 00a3409b has its CatchHandler @ 00a340a1 */
          (**(code **)(*(int *)(param_1 + 0x34) + 100))(this_00,pIVar15,2);
        }
        else {
          pCVar12 = (CNavArea *)
                    CNavMesh::GetNearestNavArea(TheNavMesh,pVVar8,true,200.0,true,true,false);
          if (pCVar11 == pCVar12) {
LAB_00a33f27:
            Path::BuildTrivialPath(this_00,pIVar15,pVVar8);
          }
          else {
            local_48 = *(float *)(iVar6 + 0x2c);
            local_44 = *(float *)(iVar6 + 0x30);
            local_40 = *(float *)(iVar6 + 0x34);
            if (pCVar12 == (CNavArea *)0x0) {
              CNavMesh::GetGroundHeight(TheNavMesh,(Vector *)&local_48,&local_40,(Vector *)0x0);
            }
            else {
              lVar18 = (longdouble)CNavArea::GetZ(pCVar12,local_48,local_44);
              local_40 = (float)lVar18;
            }
            pCVar13 = (CBaseEntity *)(**(code **)(*(int *)((int)param_2 + 0x1a3c) + 0xb4))(pIVar15);
            if (((byte)pCVar13[0x14d] & 8) != 0) {
              CBaseEntity::CalcAbsolutePosition(pCVar13);
            }
            local_3c = *(undefined4 *)(pCVar13 + 0x2e0);
            local_70 = (CNavArea *)0x0;
            local_38 = *(undefined4 *)(pCVar13 + 0x2e4);
            local_34 = *(undefined4 *)(pCVar13 + 0x2e8);
            pCVar13 = (CBaseEntity *)(**(code **)(*(int *)((int)param_2 + 0x1a3c) + 0xb4))(pIVar15);
            iVar14 = CBaseEntity::GetTeamNumber(pCVar13);
            bVar4 = NavAreaBuildPath<InfectedFleePathCost>
                              (pCVar11,pCVar12,(Vector *)&local_3c,pVVar8,
                               (InfectedFleePathCost *)&local_60,&local_70,0.0,iVar14,false);
            if (local_70 != (CNavArea *)0x0) {
              if (pCVar11 == local_70) goto LAB_00a33f27;
              iVar14 = 1;
              pCVar12 = local_70;
              do {
                pCVar12 = *(CNavArea **)(pCVar12 + 0x78);
                if (pCVar12 == (CNavArea *)0x0) break;
                iVar14 = iVar14 + 1;
              } while (pCVar11 != pCVar12);
              if (iVar14 < 0x100) {
                if (iVar14 == 1) goto LAB_00a33f27;
                *(int *)(param_1 + 0x4438) = iVar14;
              }
              else {
                iVar14 = 0xff;
                *(undefined4 *)(param_1 + 0x4438) = 0xff;
              }
              pCVar11 = local_70;
              iVar9 = iVar14;
              pIVar16 = param_1 + (iVar14 + -1) * 0x44 + 0x38;
              do {
                *(CNavArea **)pIVar16 = pCVar11;
                iVar9 = iVar9 + -1;
                CVar2 = pCVar11[0x7c];
                *(undefined4 *)(pIVar16 + 0x18) = 0;
                *(uint *)(pIVar16 + 4) = (byte)CVar2 & 0xf;
                pCVar11 = *(CNavArea **)(pCVar11 + 0x78);
                if (pCVar11 == (CNavArea *)0x0) break;
                pIVar16 = pIVar16 + -0x44;
              } while (iVar9 != 0);
              iVar14 = iVar14 * 0x44;
              *(CNavArea **)(param_1 + iVar14 + 0x38) = local_70;
              *(float *)(this_00 + iVar14 + 0xc) = local_48;
              *(float *)(this_00 + iVar14 + 0x10) = local_44;
              *(float *)(this_00 + iVar14 + 0x14) = local_40;
              iVar14 = *(int *)(param_1 + 0x4438);
              *(undefined4 *)(param_1 + iVar14 * 0x44 + 0x4c) = 0;
              *(undefined4 *)(param_1 + iVar14 * 0x44 + 0x3c) = 9;
              *(undefined4 *)(param_1 + iVar14 * 0x44 + 0x50) = 0;
              *(int *)(param_1 + 0x4438) = iVar14 + 1;
                    /* try { // try from 00a33e15 to 00a33e4e has its CatchHandler @ 00a340a1 */
              cVar3 = Path::ComputePathDetails(this_00,pIVar15,pVVar10);
              if (cVar3 == '\0') {
                (**(code **)(*(int *)(param_1 + 0x34) + 0x48))(this_00);
                (**(code **)(*(int *)(param_1 + 0x34) + 100))(this_00,pIVar15,2);
              }
              else {
                    /* try { // try from 00a33ef4 to 00a33f45 has its CatchHandler @ 00a340a1 */
                Path::Optimize((INextBot *)this_00);
                Path::PostProcess(this_00);
                (**(code **)(*(int *)(param_1 + 0x34) + 100))(this_00,pIVar15,!bVar4);
              }
            }
          }
        }
        iVar14 = _DAT_0105db00;
        if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
           (iVar9 = ThreadGetCurrentId(), iVar14 == iVar9)) {
          cVar3 = CVProfNode::ExitScope();
          if (cVar3 != '\0') {
            _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
          }
          DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
        }
        if (local_4c != 0) {
          (**(code **)(local_4c + 0x54))(local_4c,local_54,local_50,0,0,0);
        }
        *(int *)(param_1 + 0x4814) = iVar6;
      }
    }
  }
  else {
    if ((*(byte *)((int)param_2 + 0x14d) & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
    }
    fVar19 = *(float *)((int)param_2 + 0x2e0) - *(float *)(iVar6 + 0x2c);
    fVar21 = *(float *)((int)param_2 + 0x2e8) - *(float *)(iVar6 + 0x34);
    fVar20 = *(float *)((int)param_2 + 0x2e4) - *(float *)(iVar6 + 0x30);
    if ((fVar19 * fVar19 + fVar21 * fVar21 + fVar20 * fVar20 < 250000.0) ||
       (iVar6 = *(int *)(param_1 + 0x4814), iVar6 == 0)) goto LAB_00a33880;
  }
  local_80 = (PathFollower *)(param_1 + 0x34);
  if (iVar6 == 0) goto LAB_00a3381b;
  if (*(int *)(z_Infected_debug._28_4_ + 0x30) == 0) {
    pIVar15 = (INextBot *)0x0;
    if (param_2 != 0.0) goto LAB_00a33806;
  }
  else {
    if ((*(byte *)((int)param_2 + 0x14d) & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
    }
    NDebugOverlay::HorzArrow
              ((Vector *)((int)param_2 + 0x2e0),(Vector *)(iVar6 + 0x2c),1.0,0xff,0xff,0,0xff,true,
               0.2);
LAB_00a33806:
    pIVar15 = (INextBot *)((int)param_2 + 0x1a3c);
  }
  PathFollower::Update(local_80,pIVar15);
LAB_00a3381b:
  AvoidNeighbors((Infected *)param_2,(CBaseEntity *)0x0,local_80);
  piVar5 = (int *)(**(code **)(*(int *)param_2 + 0x590))(param_2);
  cVar3 = (**(code **)(*piVar5 + 200))(piVar5);
  if (((cVar3 == '\0') && (cVar3 = (**(code **)(*piVar5 + 0x114))(piVar5), cVar3 == '\0')) &&
     (cVar3 = (**(code **)(*piVar5 + 0xf8))(piVar5), cVar3 != '\0')) {
    piVar5 = (int *)(**(code **)(*(int *)param_2 + 0x594))(param_2);
    if ((*(byte *)((int)param_2 + 0x1c74) & 4) == 0) {
      cVar3 = (**(code **)(*piVar5 + 0x100))(piVar5,0);
      if (cVar3 == '\0') {
        cVar3 = (**(code **)(*piVar5 + 0xe4))(piVar5,0x260);
        if (cVar3 == '\0') {
          (**(code **)(*piVar5 + 0xd8))(piVar5,0x260,0);
        }
      }
      else {
        cVar3 = (**(code **)(*piVar5 + 0xe4))(piVar5,0x255);
        if (cVar3 == '\0') {
          (**(code **)(*piVar5 + 0xd8))(piVar5,0x255,0);
        }
      }
    }
    else {
      cVar3 = (**(code **)(*piVar5 + 0xe4))(piVar5,0x261);
      if (cVar3 == '\0') {
        (**(code **)(*piVar5 + 0xd8))(piVar5,0x261,0);
      }
    }
  }
  *(undefined4 *)this = 0;
  *(undefined4 *)(this + 4) = 0;
  *(undefined4 *)(this + 8) = 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)