L L4D2node

Infected::Update

0x00a13070 · 1643 bytes · __thiscall

_ZN8Infected6UpdateEv

Decompiled

undefined (1 param)

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

void __thiscall Infected::Update(Infected *this)

{
  LowestFlowDistance *pLVar1;
  uint *puVar2;
  char cVar3;
  int iVar4;
  int iVar5;
  int iVar6;
  CBaseEntity *pCVar7;
  longdouble lVar8;
  undefined1 *this_00;
  INextBot *this_01;
  undefined4 local_4c;
  undefined4 local_48;
  undefined4 local_40;
  undefined4 local_3c;
  int local_38;
  float local_34 [3];
  int local_28;
  undefined4 local_24;
  undefined4 local_20;
  
  local_4c = 0;
  local_48 = 0;
  if (_towlower == 0) {
    local_38 = 0;
  }
  else {
    (**(code **)(_towlower + 0x50))
              (_towlower,&local_4c,0,0,0,0,
               "/data/src/game/server/terror/zombiebot/infected/infected.cpp",0x356,
               &Update()::tm_fmt,"(%s)%s","NextBot","Infected::Update");
    local_38 = _towlower;
  }
  iVar4 = _DAT_0105db00;
  local_40 = local_4c;
  local_3c = local_48;
                    /* try { // try from 00a132a6 to 00a13306 has its CatchHandler @ 00a136fd */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar5 = ThreadGetCurrentId(), iVar4 == iVar5)) {
    if ((char *)*_DAT_0105d15c != "Infected::Update") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xd1fe93,(char *)0x0,0xca8906);
    }
    puVar2 = (uint *)(_DAT_0105d1e8 + 4 + _DAT_0105d15c[0x1c] * 8);
    *puVar2 = *puVar2 | 4;
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  this_01 = (INextBot *)(this + 0x1a3c);
                    /* try { // try from 00a13130 to 00a13244 has its CatchHandler @ 00a13712 */
  INextBot::Update(this_01);
  if (*(int *)(ZombieDebug._28_4_ + 0x30) != 0) {
    DrawInfectedDebug(this);
  }
  CheckSurvivorVisibility(this);
  CheckActiveSet(this);
  UpdateNeighbors(this);
  UpdateClientAnimationLayers(this);
  this_00 = TheDirector;
  cVar3 = CDirector::IsBackgroundMap();
  if (cVar3 == '\0') {
    if (((byte)this[0x1c74] & 1) != 0) {
                    /* try { // try from 00a13585 to 00a136fa has its CatchHandler @ 00a13712 */
      iVar4 = (**(code **)(*(int *)this + 0x52c))(this);
      if (iVar4 != 0) {
        this_00 = (undefined1 *)local_34;
        local_34[0] = 1e+09;
        local_34[1] = 2.8026e-45;
        local_34[2] = 0.0;
        local_28 = 0;
        local_24 = 0;
        ForEachSurvivor<LowestFlowDistance>((LowestFlowDistance *)this_00);
        if (local_34[0] < *(float *)(iVar4 + 0x154) || local_34[0] == *(float *)(iVar4 + 0x154))
        goto LAB_00a13187;
      }
      this_00 = this;
      SetReservedWandererStatus(this,false);
    }
LAB_00a13187:
    if ((*(int *)(ZombieNoCull._28_4_ + 0x30) == 0) &&
       (this_00 = this, cVar3 = (**(code **)(*(int *)this + 0x5b4))(this,0), cVar3 != '\0')) {
      pLVar1 = (LowestFlowDistance *)(this + 0x1cc8);
      this_00 = pLVar1;
      lVar8 = (longdouble)CountdownTimer::Now();
      if ((*(float *)(this + 0x1cd0) <= (float)lVar8) &&
         ((this_00 = this, lVar8 = (longdouble)(**(code **)(*(int *)this + 0x4a0))(this),
          3.0 < (float)lVar8 && (((byte)this[0x1c74] & 1) == 0)))) {
        lVar8 = (longdouble)CountdownTimer::Now();
        if ((float)lVar8 + 3.0 != *(float *)(this + 0x1cd0)) {
          (**(code **)(*(int *)(this + 0x1cc8) + 4))(pLVar1,this + 0x1cd0);
          *(float *)(this + 0x1cd0) = (float)lVar8 + 3.0;
        }
        if (*(float *)(this + 0x1ccc) != 3.0) {
          (**(code **)(*(int *)(this + 0x1cc8) + 4))(pLVar1,this + 0x1ccc);
          *(undefined4 *)(this + 0x1ccc) = 0x40400000;
        }
        iVar4 = CDirector::GetCommonInfectedLimit((CDirector *)TheDirector);
        iVar5 = CDirectorTacticalServices::GetCommonInfectedCount
                          (*(CDirectorTacticalServices **)(TheDirector + 0x628),0);
        if ((iVar4 < iVar5) ||
           (this_00 = TheZombieManager, cVar3 = ZombieManager::IsMobWaitingToSpawn(TheZombieManager)
           , cVar3 != '\0')) {
          this_00 = (undefined1 *)(**(code **)(*(int *)this + 0x594))(this);
          cVar3 = (**(code **)(*(int *)this_00 + 0x114))(this_00,2);
          if ((cVar3 == '\0') &&
             ((this_00 = this, iVar4 = (**(code **)(*(int *)this + 0x52c))(this), iVar4 == 0 ||
              (*(char *)(iVar4 + 0x7d) == '\0')))) {
            this_00 = *(undefined1 **)(TheDirector + 0x628);
            cVar3 = CDirectorTacticalServices::IsVisibleToTeam
                              ((CDirectorTacticalServices *)this_00,(CBaseEntity *)this,2,0,0.0,
                               (TerrorNavArea *)0x0);
            if (cVar3 == '\0') {
              if (iVar4 != 0) {
                iVar6 = *(int *)(iVar4 + 0x128) + 1;
                iVar5 = 0;
                if (-1 < iVar6) {
                  iVar5 = iVar6;
                }
                *(int *)(iVar4 + 0x128) = iVar5;
              }
              UTIL_Remove((CBaseEntity *)this);
              CVProfile::ExitScope((CVProfile *)&g_VProfCurrentProfile);
              Tm_Zone::~Tm_Zone((Tm_Zone *)&local_40);
              return;
            }
          }
        }
      }
    }
  }
  if (this[0x1cbd] == (Infected)0x0) goto LAB_00a131a4;
  this_00 = (undefined1 *)(**(code **)(*(int *)this + 0x594))(this);
  cVar3 = (**(code **)(*(int *)this_00 + 0x114))(this_00,2);
  if (cVar3 != '\0') goto LAB_00a131a4;
  iVar4 = CDirectorTacticalServices::GetClosestCharacterWhoIsIT
                    (*(CDirectorTacticalServices **)(TheDirector + 0x628),
                     (CBaseCombatCharacter *)this);
  if (iVar4 == 0) {
    cVar3 = CDirector::IsFinale((CDirector *)TheDirector);
    if ((cVar3 == '\0') && (**(char **)(TheDirector + 0x640) == '\0')) {
      cVar3 = IsInCommentaryMode();
      if (cVar3 == '\0') {
        this_00 = *(undefined1 **)(TheDirector + 0x628);
        iVar4 = CDirectorTacticalServices::GetHighestFlowSurvivor
                          ((CDirectorTacticalServices *)this_00,0);
      }
      else {
        local_34[0] = -9999.0;
        local_34[1] = 2.8026e-45;
        local_34[2] = 0.0;
        local_28 = 0;
        local_24 = 0;
        local_20 = 0;
        ForEachSurvivorBot<HighestFlowDistance>((HighestFlowDistance *)local_34);
        iVar4 = local_28;
        if (local_28 != 0) goto LAB_00a133c5;
        this_00 = *(undefined1 **)(TheDirector + 0x628);
        iVar4 = CDirectorTacticalServices::GetRandomSurvivor();
      }
    }
    else {
      this_00 = *(undefined1 **)(TheDirector + 0x628);
      iVar4 = CDirectorTacticalServices::GetRandomSurvivor();
    }
    if (iVar4 == 0) goto LAB_00a131a4;
  }
LAB_00a133c5:
  this_00 = this_01;
  (**(code **)(*(int *)(this + 0x1a3c) + 0x84))(this_01,iVar4);
LAB_00a131a4:
  if (this[0x1cbe] != (Infected)0x0) {
    if (((byte)this[0x14d] & 8) != 0) {
                    /* try { // try from 00a13363 to 00a1355c has its CatchHandler @ 00a13712 */
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    this_00 = gEntList;
    iVar4 = CGlobalEntityList::FindEntityByClassnameNearest
                      ((CGlobalEntityList *)gEntList,"info_ambient_mob_start",
                       (Vector *)(this + 0x2e0),16384.0);
    pCVar7 = (CBaseEntity *)0x0;
    if (iVar4 != 0) {
      do {
        pCVar7 = (CBaseEntity *)
                 CGlobalEntityList::FindEntityByClassname
                           ((CGlobalEntityList *)gEntList,pCVar7,"info_ambient_mob_end");
        if (pCVar7 == (CBaseEntity *)0x0) {
          Msg("ERROR - Could not find any ambient mob destination ents!\n");
          break;
        }
      } while (*(int *)(iVar4 + 0x154) != *(int *)(pCVar7 + 0x154));
      this[0x1cbe] = (Infected)0x0;
      (**(code **)(*(int *)(this + 0x1a3c) + 0x90))(this_01,pCVar7);
      this_00 = this_01;
    }
  }
  iVar4 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar5 = ThreadGetCurrentId(this_00), iVar4 == iVar5)) {
    cVar3 = CVProfNode::ExitScope();
    if (cVar3 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_38 != 0) {
    (**(code **)(local_38 + 0x54))(local_38,local_40,local_3c,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)