L L4D2node

WitchRetreat::Update

0x00a41820 · 1079 bytes · __thiscall

_ZN12WitchRetreat6UpdateEP8Infectedf

Decompiled

undefined (3 params)

/* WitchRetreat::Update(Infected*, float) */

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

{
  float fVar1;
  char cVar2;
  int *piVar3;
  int *piVar4;
  int iVar5;
  longdouble lVar6;
  
  piVar3 = (int *)(**(code **)(*(int *)param_2 + 0x590))(param_2);
  piVar4 = (int *)(**(code **)(*(int *)param_2 + 0x594))(param_2);
  fVar1 = *(float *)(WitchRetreatMinDuration._28_4_ + 0x2c);
  lVar6 = (longdouble)IntervalTimer::Now();
  if (fVar1 < (float)lVar6 - *(float *)(param_1 + 0x4830)) {
    cVar2 = CDirectorTacticalServices::IsVisibleToTeam
                      (*(CDirectorTacticalServices **)(TheDirector + 0x628),(CBaseEntity *)param_2,2
                       ,0,0.0,(TerrorNavArea *)0x0);
    if (cVar2 != '\0') {
      lVar6 = (longdouble)IntervalTimer::Now();
      if ((float)lVar6 != *(float *)(param_1 + 0x4838)) {
        (**(code **)(*(int *)(param_1 + 0x4834) + 4))(param_1 + 0x4834,param_1 + 0x4838);
        *(float *)(param_1 + 0x4838) = (float)lVar6;
      }
    }
    iVar5 = CDirectorTacticalServices::GetClosestSurvivor
                      (*(CDirectorTacticalServices **)(TheDirector + 0x628),
                       (CBaseCombatCharacter *)param_2,true,true);
    if (iVar5 != 0) {
      cVar2 = (**(code **)(*(int *)((int)param_2 + 0x1a3c) + 0x11c))
                        ((int)param_2 + 0x1a3c,iVar5,
                         *(undefined4 *)(WitchRetreatExitRange._28_4_ + 0x2c));
      if (cVar2 != '\0') {
        lVar6 = (longdouble)IntervalTimer::Now();
        if (1.0 < (float)lVar6 - *(float *)(param_1 + 0x4838)) goto LAB_00a41950;
      }
      fVar1 = *(float *)(WitchRetreatExitHiddenDuration._28_4_ + 0x2c);
      lVar6 = (longdouble)IntervalTimer::Now();
      if ((float)lVar6 - *(float *)(param_1 + 0x4838) <= fVar1) goto LAB_00a419b0;
    }
LAB_00a41950:
    UTIL_Remove((CBaseEntity *)param_2);
    *(undefined4 *)this = 3;
    *(undefined4 *)(this + 4) = 0;
    *(undefined4 *)(this + 8) = 0;
    return this;
  }
LAB_00a419b0:
  lVar6 = (longdouble)CountdownTimer::Now();
  if (*(float *)(param_1 + 0x4828) <= (float)lVar6) {
    lVar6 = (longdouble)RandomFloat(0x3fc00000,0x40200000);
    fVar1 = (float)lVar6;
    lVar6 = (longdouble)CountdownTimer::Now();
    if ((float)lVar6 + fVar1 != *(float *)(param_1 + 0x4828)) {
      (**(code **)(*(int *)(param_1 + 0x4820) + 4))(param_1 + 0x4820,param_1 + 0x4828);
      *(float *)(param_1 + 0x4828) = (float)lVar6 + fVar1;
    }
    if (fVar1 != *(float *)(param_1 + 0x4824)) {
      (**(code **)(*(int *)(param_1 + 0x4820) + 4))(param_1 + 0x4820,param_1 + 0x4824);
      *(float *)(param_1 + 0x4824) = fVar1;
    }
    CBaseEntity::EmitSound((CBaseEntity *)param_2,"WitchZombie.RetreatHorror",0.0,(float *)0x0);
  }
  cVar2 = (**(code **)(*piVar4 + 0xe4))(piVar4,0x2ad);
  if (cVar2 == '\0') {
    PathFollower::Update((PathFollower *)(param_1 + 0x34),(INextBot *)((int)param_2 + 0x1a3c));
    cVar2 = (**(code **)(*piVar3 + 200))(piVar3);
    if (cVar2 == '\0') {
      cVar2 = (**(code **)(*piVar3 + 0x114))(piVar3);
      if (cVar2 == '\0') {
        cVar2 = (**(code **)(*piVar3 + 0xf8))(piVar3);
        if (cVar2 != '\0') {
          cVar2 = (**(code **)(*piVar4 + 0x100))(piVar4,0);
          if (cVar2 == '\0') {
            cVar2 = (**(code **)(*piVar4 + 0xe4))(piVar4,0x260);
            if (cVar2 == '\0') {
              (**(code **)(*piVar4 + 0xd8))(piVar4,0x260,0);
            }
          }
          else {
            cVar2 = (**(code **)(*piVar4 + 0xe4))(piVar4,0x2ae);
            if (cVar2 == '\0') {
              (**(code **)(*piVar4 + 0xd8))(piVar4,0x2ae,0);
            }
          }
        }
      }
    }
  }
  else {
    piVar3 = (int *)(**(code **)(*(int *)param_2 + 0x590))(param_2);
    (**(code **)(*piVar3 + 0xe0))(piVar3);
    piVar3 = (int *)(**(code **)(*(int *)param_2 + 0x590))(param_2);
    (**(code **)(*piVar3 + 0x18c))(piVar3,&vec3_origin);
    CBaseEntity::SetAbsVelocity((CBaseEntity *)param_2,(Vector *)&vec3_origin);
  }
  *(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)