L L4D2node

SmokerAttack::Update

0x00ac4ea0 · 2389 bytes · __thiscall

_ZN12SmokerAttack6UpdateEP6Smokerf

Decompiled

undefined (3 params)

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

SmokerAttack * __thiscall SmokerAttack::Update(SmokerAttack *this,Smoker *param_1,float param_2)

{
  int iVar1;
  float fVar2;
  uint uVar3;
  code *pcVar4;
  int iVar5;
  char cVar6;
  Smoker SVar7;
  int *piVar8;
  int *piVar9;
  uint *puVar10;
  int *piVar11;
  Smoker *pSVar12;
  int iVar13;
  undefined4 *puVar14;
  SmokerMoveToAttackPosition *this_00;
  Vector *pVVar15;
  CTerrorPlayer *pCVar16;
  undefined *puVar17;
  undefined4 uVar18;
  longdouble lVar19;
  longdouble lVar20;
  int local_54;
  int local_4c;
  int local_48;
  int local_44;
  int local_40;
  int local_3c;
  int local_38;
  int local_34;
  int local_30;
  undefined **local_2c;
  float local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  piVar8 = (int *)(**(code **)(*(int *)param_2 + 0x9b4))();
  pCVar16 = (CTerrorPlayer *)0x0;
  uVar3 = *(uint *)(param_1 + 0x34);
  if (((uVar3 != 0xffffffff) &&
      (puVar17 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar17 != (undefined *)0xfffffffc)) &&
     (*(uint *)(puVar17 + 8) == uVar3 >> 0xc)) {
    pCVar16 = *(CTerrorPlayer **)(puVar17 + 4);
  }
  piVar9 = (int *)BossZombiePlayerBot::ChooseVictim
                            ((BossZombiePlayerBot *)param_2,pCVar16,4,(CBaseCombatCharacter *)0x0);
  if (piVar9 == (int *)0x0) {
    *(undefined4 *)(param_1 + 0x34) = 0xffffffff;
    goto LAB_00ac4f47;
  }
  puVar10 = (uint *)(**(code **)(*piVar9 + 0xc))();
  puVar17 = g_pEntityList;
  uVar3 = *puVar10;
  *(uint *)(param_1 + 0x34) = uVar3;
  if (((uVar3 == 0xffffffff) ||
      (puVar17 = puVar17 + (uVar3 & 0xfff) * 0x10, puVar17 == (undefined *)0xfffffffc)) ||
     ((*(uint *)(puVar17 + 8) != uVar3 >> 0xc ||
      ((*(int **)(puVar17 + 4) == (int *)0x0 ||
       (cVar6 = (**(code **)(**(int **)(puVar17 + 4) + 300))(), cVar6 == '\0'))))))
  goto LAB_00ac4f47;
  uVar3 = *(uint *)((int)param_2 + 0x30bc);
  if ((uVar3 == 0xffffffff) ||
     (((puVar17 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar17 == (undefined *)0xfffffffc ||
       (*(uint *)(puVar17 + 8) != uVar3 >> 0xc)) ||
      (piVar9 = *(int **)(puVar17 + 4), piVar9 == (int *)0x0)))) {
    *(undefined4 *)this = 3;
    *(undefined4 *)(this + 4) = 0;
    *(char **)(this + 8) = "No ability!";
    return this;
  }
  if (0 < *(int *)(param_1 + 0x443c)) {
    piVar11 = (int *)(**(code **)(*(int *)param_2 + 0x9b0))();
    cVar6 = (**(code **)(*piVar11 + 0x114))();
    if (cVar6 != '\0') {
      uVar18 = 0;
      uVar3 = *(uint *)(param_1 + 0x34);
      if (((uVar3 != 0xffffffff) &&
          (puVar17 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar17 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar17 + 8) == uVar3 >> 0xc)) {
        uVar18 = *(undefined4 *)(puVar17 + 4);
      }
      local_2c = &PTR_operator___00d34e38;
      local_28 = param_2;
      local_24 = (**(code **)(*(int *)param_2 + 0x9b0))();
      local_54 = 0;
      uVar3 = *(uint *)(param_1 + 0x34);
      if (((uVar3 != 0xffffffff) &&
          (puVar17 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar17 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar17 + 8) == uVar3 >> 0xc)) {
        local_54 = *(int *)(puVar17 + 4);
      }
      iVar1 = (int)param_2 + 0x4028;
      pSVar12 = param_1 + 0x38;
      local_20 = uVar18;
      piVar8 = (int *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 0xc0))();
      cVar6 = (**(code **)(*(int *)((int)param_2 + 0x4028) + 0x104))();
      if ((((cVar6 == '\0') && (cVar6 = (**(code **)(*piVar8 + 0xd4))(), cVar6 == '\0')) &&
          (cVar6 = (**(code **)(*(int *)(param_1 + 0x38) + 0x80))(), cVar6 == '\0')) &&
         (cVar6 = (**(code **)(*(int *)(param_1 + 0x38) + 0x80))(), cVar6 == '\0')) {
        (**(code **)(*(int *)(param_1 + 0x38) + 0x90))();
        piVar9 = (int *)&stack0xffffff70;
        local_44 = local_38;
        local_40 = local_34;
        local_3c = local_30;
        pcVar4 = *(code **)(*piVar8 + 0x158);
        (**(code **)(*piVar8 + 300))();
        cVar6 = (*pcVar4)();
        if (cVar6 != '\0') {
          if (*(int *)(DirectChaseNavCheck._28_4_ + 0x30) != 0) {
            pVVar15 = (Vector *)(**(code **)(*piVar8 + 300))();
            cVar6 = CNavMesh::DoesRayStayWithinMesh(TheNavMesh,pVVar15,(Vector *)&local_38);
            if (cVar6 == '\0') goto LAB_00ac5836;
          }
          (**(code **)(*piVar8 + 0x120))();
          (**(code **)(*piVar8 + 0xb4))();
          piVar8 = (int *)(**(code **)(*(int *)((int)param_2 + 0x4028) + 0xc4))();
          (**(code **)(*piVar8 + 0xc4))();
          (**(code **)(*(int *)(param_1 + 0x38) + 0x48))();
          param_1[0x4844] = (Smoker)0x1;
          goto LAB_00ac5242;
        }
LAB_00ac5836:
        piVar8 = &local_44;
        piVar9 = (int *)&stack0xffffff70;
      }
      else {
        piVar8 = (int *)0x0;
        piVar9 = (int *)&stack0xffffff74;
      }
      local_4c = 0;
      local_48 = 0;
      if (_towlower == 0) {
        local_30 = 0;
      }
      else {
        *piVar9 = _towlower;
        piVar9[1] = (int)&local_4c;
        piVar9[0xb] = (int)"ChasePath::Update";
        piVar9[10] = (int)"NextBot";
        piVar9[9] = (int)"(%s)%s";
        piVar9[8] = (int)&ChasePath::Update(INextBot*,CBaseEntity*,IPathCost_const&,Vector*)::tm_fmt
        ;
        piVar9[7] = 0x68;
        piVar9[6] = (int)"/data/src/game/server/nextbot/path/nextbotchasepath.h";
        piVar9[5] = 0;
        piVar9[3] = 0;
        piVar9[4] = 0;
        piVar9[2] = 0;
        pcVar4 = *(code **)(_towlower + 0x50);
        piVar9[-1] = 0xac5166;
        (*pcVar4)();
        local_30 = _towlower;
      }
      iVar5 = _DAT_0105db00;
      local_38 = local_4c;
      local_34 = local_48;
      if ((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) {
                    /* try { // try from 00ac5196 to 00ac519a has its CatchHandler @ 00ac5860 */
        piVar9[-1] = 0xac519b;
        iVar13 = ThreadGetCurrentId();
        if (iVar5 == iVar13) {
          if ((char *)*_DAT_0105d15c != "ChasePath::Update") {
            piVar9[4] = 4;
            piVar9[3] = (int)"NextBot";
            piVar9[2] = 0;
            piVar9[1] = (int)"ChasePath::Update";
            *piVar9 = (int)_DAT_0105d15c;
                    /* try { // try from 00ac57d0 to 00ac57f3 has its CatchHandler @ 00ac5860 */
            piVar9[-1] = 0xac57d5;
            _DAT_0105d15c =
                 (int *)CVProfNode::GetSubNode
                                  ((char *)*piVar9,piVar9[1],(char *)piVar9[2],piVar9[3]);
          }
          puVar10 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
          *puVar10 = *puVar10 | 4;
          *piVar9 = (int)_DAT_0105d15c;
          piVar9[-1] = 0xac57f4;
          CVProfNode::EnterScope();
          DAT_0105d158 = '\0';
        }
      }
      piVar9[4] = (int)piVar8;
      piVar9[3] = (int)&local_2c;
      piVar9[1] = iVar1;
      *piVar9 = (int)pSVar12;
      piVar9[2] = local_54;
                    /* try { // try from 00ac51c0 to 00ac51d0 has its CatchHandler @ 00ac5875 */
      piVar9[-1] = 0xac51c5;
      ChasePath::RefreshPath
                ((ChasePath *)*piVar9,(INextBot *)piVar9[1],(CBaseEntity *)piVar9[2],
                 (IPathCost *)piVar9[3],(Vector *)piVar9[4]);
      piVar9[1] = iVar1;
      *piVar9 = (int)pSVar12;
      piVar9[-1] = 0xac51d1;
      PathFollower::Update((PathFollower *)*piVar9,(INextBot *)piVar9[1]);
      iVar5 = _DAT_0105db00;
      if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
        piVar9[-1] = 0xac51ef;
        iVar13 = ThreadGetCurrentId();
        if (iVar5 == iVar13) {
          *piVar9 = (int)_DAT_0105d15c;
          piVar9[-1] = 0xac5775;
          cVar6 = CVProfNode::ExitScope();
          if (cVar6 != '\0') {
            _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
          }
          DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
        }
      }
      if (local_30 != 0) {
        piVar9[5] = 0;
        piVar9[4] = 0;
        piVar9[3] = 0;
        *piVar9 = local_30;
        piVar9[1] = local_38;
        piVar9[2] = local_34;
        pcVar4 = *(code **)(local_30 + 0x54);
        piVar9[-1] = 0xac522a;
        (*pcVar4)();
      }
      iVar5 = *(int *)(param_1 + 0x38);
      *piVar9 = (int)pSVar12;
      pcVar4 = *(code **)(iVar5 + 0x44);
      piVar9[-1] = 0xac5239;
      SVar7 = (Smoker)(*pcVar4)();
      param_1[0x4844] = SVar7;
LAB_00ac5242:
      piVar9[1] = iVar1;
      piVar9[2] = local_54;
      *piVar9 = (int)pSVar12;
      piVar9[-1] = 0xac5258;
      DirectChasePath::NotifyVictim
                ((DirectChasePath *)*piVar9,(INextBot *)piVar9[1],(CBaseEntity *)piVar9[2]);
      *(undefined4 *)this = 0;
      *(undefined4 *)(this + 4) = 0;
      *(undefined4 *)(this + 8) = 0;
      return this;
    }
  }
  (**(code **)(*piVar8 + 0xc4))();
  cVar6 = CDirectorTacticalServices::IsVisibleToTeam
                    (*(CDirectorTacticalServices **)(TheDirector + 0x628),(CBaseEntity *)param_2,2,0
                     ,0.0,(TerrorNavArea *)0x0);
  if ((cVar6 == '\0') && (cVar6 = (**(code **)(*(int *)param_2 + 0x998))(), cVar6 == '\0')) {
    lVar19 = (longdouble)CTerrorPlayer::GetFlowDistance();
    fVar2 = *(float *)(ZombieAttackFlowRange._28_4_ + 0x2c);
    lVar20 = (longdouble)CTerrorPlayer::GetFlowDistance();
    if ((float)lVar20 < (float)lVar19 - fVar2) goto LAB_00ac4f47;
  }
  cVar6 = (**(code **)(*piVar9 + 0x32c))();
  if (((cVar6 != '\0') && (*(int *)(ZombieAllowAIToUseAbilities._28_4_ + 0x30) != 0)) &&
     (cVar6 = (**(code **)(*(int *)param_2 + 0x99c))(), cVar6 == '\0')) {
    pCVar16 = (CTerrorPlayer *)0x0;
    uVar3 = *(uint *)(param_1 + 0x34);
    if (((uVar3 != 0xffffffff) &&
        (puVar17 = g_pEntityList + (uVar3 & 0xfff) * 0x10, puVar17 != (undefined *)0xfffffffc)) &&
       (*(uint *)(puVar17 + 8) == uVar3 >> 0xc)) {
      pCVar16 = *(CTerrorPlayer **)(puVar17 + 4);
    }
    this_00 = ::operator_new(0x4830);
                    /* try { // try from 00ac5722 to 00ac5726 has its CatchHandler @ 00ac5885 */
    SmokerMoveToAttackPosition::SmokerMoveToAttackPosition(this_00,pCVar16);
    *(undefined4 *)this = 2;
    *(SmokerMoveToAttackPosition **)(this + 4) = this_00;
    *(char **)(this + 8) = "Moving into attack position...";
    *(undefined4 *)(param_1 + 0x20) = 0;
    *(undefined4 *)(param_1 + 0x24) = 0;
    *(undefined4 *)(param_1 + 0x28) = 0;
    *(undefined4 *)(param_1 + 0x2c) = 0;
    return this;
  }
  cVar6 = CDirectorTacticalServices::IsVisibleToTeam
                    (*(CDirectorTacticalServices **)(TheDirector + 0x628),(CBaseEntity *)param_2,2,1
                     ,0.0,(TerrorNavArea *)0x0);
  if (cVar6 != '\0') {
    puVar14 = ::operator_new(0x4814);
    puVar14[8] = 0;
    puVar14[9] = 0;
    puVar14[10] = 0;
    puVar14[3] = 0;
    puVar14[4] = 0;
    puVar14[5] = 0;
    puVar14[6] = 0;
    puVar14[7] = 0;
    puVar14[2] = 0;
    *(undefined1 *)(puVar14 + 0xc) = 0;
    *(undefined1 *)((int)puVar14 + 0x31) = 0;
    puVar14[0xb] = 0;
    *puVar14 = &PTR__SmokerRetreatToCover_00d35a48;
    puVar14[1] = &PTR__SmokerRetreatToCover_00d35bac;
                    /* try { // try from 00ac55c9 to 00ac55cd has its CatchHandler @ 00ac5846 */
    PathFollower::PathFollower((PathFollower *)(puVar14 + 0xd));
    *(undefined4 *)this = 2;
    *(undefined4 **)(this + 4) = puVar14;
    *(undefined4 *)(this + 8) = 0;
    *(undefined4 *)(param_1 + 0x20) = 0;
    *(undefined4 *)(param_1 + 0x24) = 0;
    *(undefined4 *)(param_1 + 0x28) = 0;
    *(undefined4 *)(param_1 + 0x2c) = 0;
    return this;
  }
LAB_00ac4f47:
  *(undefined4 *)this = 0;
  *(undefined4 *)(this + 4) = 0;
  *(undefined4 *)(this + 8) = 0;
  return this;
}

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)