L L4D2node

WitchIdle::Update

0x00a40440 · 1181 bytes · __thiscall

_ZN9WitchIdle6UpdateEP8Infectedf

Decompiled

undefined (3 params)

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

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

{
  float fVar1;
  uint uVar2;
  char cVar3;
  int *piVar4;
  CBaseEntity *pCVar5;
  WitchAngry *pWVar6;
  Vector *pVVar7;
  undefined *puVar8;
  longdouble lVar9;
  undefined4 uVar10;
  float local_24;
  
  piVar4 = (int *)(**(code **)(*(int *)param_2 + 0x590))(param_2);
  (**(code **)(*piVar4 + 0xe0))(piVar4);
  piVar4 = (int *)(**(code **)(*(int *)param_2 + 0x590))(param_2);
  (**(code **)(*piVar4 + 0x18c))(piVar4,&vec3_origin);
  CBaseEntity::SetAbsVelocity((CBaseEntity *)param_2,(Vector *)&vec3_origin);
  lVar9 = (longdouble)CountdownTimer::Now();
  if (*(float *)(param_1 + 0x3c) <= (float)lVar9) {
    CBaseEntity::EmitSound((CBaseEntity *)param_2,"WitchZombie.Despair",0.0,(float *)0x0);
    lVar9 = (longdouble)RandomFloat(0x40800000,0x40c00000);
    fVar1 = (float)lVar9;
    lVar9 = (longdouble)CountdownTimer::Now();
    if ((float)lVar9 + fVar1 != *(float *)(param_1 + 0x3c)) {
      (**(code **)(*(int *)(param_1 + 0x34) + 4))(param_1 + 0x34,param_1 + 0x3c);
      *(float *)(param_1 + 0x3c) = (float)lVar9 + fVar1;
    }
    if (fVar1 != *(float *)(param_1 + 0x38)) {
      (**(code **)(*(int *)(param_1 + 0x34) + 4))(param_1 + 0x34,param_1 + 0x38);
      *(float *)(param_1 + 0x38) = fVar1;
    }
    if ((*(byte *)((int)param_2 + 0x14d) & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)param_2);
    }
    CSoundEnt::InsertSound
              (8,(Vector *)((int)param_2 + 0x2e0),0x800,fVar1,(CBaseEntity *)param_2,10,
               (CBaseEntity *)0x0);
  }
  piVar4 = (int *)(**(code **)(*(int *)param_2 + 0x59c))(param_2);
  pCVar5 = (CBaseEntity *)(**(code **)(*piVar4 + 0xb4))(piVar4);
  if (pCVar5 == (CBaseEntity *)0x0) {
    if (0.0 < *(float *)(param_1 + 0x48)) {
      lVar9 = (longdouble)CountdownTimer::Now();
      if ((float)lVar9 < *(float *)(param_1 + 0x48)) goto LAB_00a406f2;
      uVar2 = *(uint *)(param_1 + 0x4c);
      if (((uVar2 != 0xffffffff) &&
          (puVar8 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar8 + 8) == uVar2 >> 0xc)) {
        pCVar5 = *(CBaseEntity **)(puVar8 + 4);
      }
      if (*(float *)(param_1 + 0x48) != -1.0) {
        (**(code **)(*(int *)(param_1 + 0x40) + 4))(param_1 + 0x40,param_1 + 0x48);
        *(undefined4 *)(param_1 + 0x48) = 0xbf800000;
      }
      if (pCVar5 == (CBaseEntity *)0x0) goto LAB_00a406f2;
    }
    else {
LAB_00a406f2:
      pVVar7 = (Vector *)
               (**(code **)(*(int *)((int)param_2 + 0x1a3c) + 0xd4))((int)param_2 + 0x1a3c);
      pCVar5 = (CBaseEntity *)
               CDirectorTacticalServices::GetClosestSurvivor
                         (*(CDirectorTacticalServices **)(TheDirector + 0x628),pVVar7,true,true);
      cVar3 = (**(code **)(*(int *)((int)param_2 + 0x1a3c) + 0x114))
                        ((int)param_2 + 0x1a3c,pCVar5,
                         *(undefined4 *)(ZombieWitchPersonalSpace._28_4_ + 0x2c));
      if (((cVar3 == '\0') ||
          (cVar3 = (**(code **)(*piVar4 + 0xf8))(piVar4,pCVar5,0), cVar3 == '\0')) ||
         (pCVar5 == (CBaseEntity *)0x0)) goto LAB_00a40526;
    }
    piVar4 = (int *)(**(code **)(*(int *)param_2 + 0x594))(param_2);
    (**(code **)(*piVar4 + 0x13c))(piVar4,pCVar5,2,0,0,0);
    CBaseEntity::EmitSound((CBaseEntity *)param_2,"WitchZombie.Surprised",0.0,(float *)0x0);
    local_24 = 1.0;
  }
  else {
    local_24 = 0.0;
  }
  cVar3 = Witch::IsHostileToMe((Witch *)param_2,pCVar5);
  if (cVar3 == '\0') {
    uVar10 = *(undefined4 *)(ZombieWitchThreatNormalRange._28_4_ + 0x2c);
  }
  else {
    uVar10 = *(undefined4 *)(ZombieWitchThreatHostileRange._28_4_ + 0x2c);
  }
  cVar3 = (**(code **)(*(int *)((int)param_2 + 0x1a3c) + 0x114))
                    ((int)param_2 + 0x1a3c,pCVar5,uVar10);
  if (cVar3 != '\0') {
    pWVar6 = ::operator_new(0x50);
                    /* try { // try from 00a4068c to 00a40690 has its CatchHandler @ 00a4092d */
    WitchAngry::WitchAngry(pWVar6,local_24);
    *(undefined4 *)this = 1;
    *(WitchAngry **)(this + 4) = pWVar6;
    *(undefined4 *)(this + 8) = 0;
    return this;
  }
LAB_00a40526:
  if (*(float *)((int)param_2 + 0x1d94) <= 0.0) {
    *(undefined4 *)this = 0;
    *(undefined4 *)(this + 4) = 0;
    *(undefined4 *)(this + 8) = 0;
    return this;
  }
  pWVar6 = ::operator_new(0x50);
                    /* try { // try from 00a4054d to 00a40551 has its CatchHandler @ 00a4091b */
  WitchAngry::WitchAngry(pWVar6,0.0);
  *(undefined4 *)this = 1;
  *(WitchAngry **)(this + 4) = pWVar6;
  *(char **)(this + 8) = "Increased Rage made me angry";
  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)