L L4D2node

Witch::Update

0x00a48d70 · 685 bytes · __thiscall

_ZN5Witch6UpdateEv

Decompiled

undefined (1 param)

/* Witch::Update() */

void __thiscall Witch::Update(Witch *this)

{
  float fVar1;
  uint uVar2;
  int iVar3;
  CNavArea *pCVar4;
  int iVar5;
  CStudioHdr *pCVar6;
  undefined *puVar7;
  undefined *puVar8;
  CStudioHdr *pCVar9;
  undefined4 uVar10;
  float fVar11;
  MarkAsDamagingScan local_1d [13];
  
  Infected::Update((Infected *)this);
  fVar11 = *(float *)(this + 0x1da0);
  if (0.0 < fVar11) {
    if (fVar11 == *(float *)(this + 0x1da4) + fVar11) {
      if (*(float *)(gpGlobals + 0xc) < fVar11) {
        fVar11 = 0.0;
      }
      else {
        fVar11 = 1.0;
      }
    }
    else {
      fVar11 = (*(float *)(gpGlobals + 0xc) - fVar11) /
               ((*(float *)(this + 0x1da4) + fVar11) - fVar11);
      if (1.0 <= fVar11) {
        fVar11 = 1.0;
      }
      if (fVar11 <= 0.0) {
        fVar11 = 0.0;
      }
    }
    fVar1 = *(float *)(this + 0x1d94);
    if (fVar11 <= fVar1) {
      fVar11 = fVar1;
    }
    ChangeRageLevel(this,fVar11 - fVar1);
    if (1.0 <= fVar11) {
      uVar2 = *(uint *)(this + 0x1dac);
      puVar8 = g_pEntityList;
      if ((((uVar2 != 0xffffffff) &&
           (puVar7 = g_pEntityList + (uVar2 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
          (*(uint *)(puVar7 + 8) == uVar2 >> 0xc)) &&
         (*(CBaseEntity **)(puVar7 + 4) != (CBaseEntity *)0x0)) {
        SetHarasser(this,*(CBaseEntity **)(puVar7 + 4));
        puVar8 = g_pEntityList;
        *(undefined4 *)(this + 0x1dac) = 0xffffffff;
      }
      uVar10 = 0;
      uVar2 = *(uint *)(this + 0x1da8);
      if (((uVar2 != 0xffffffff) &&
          (puVar8 = puVar8 + (uVar2 & 0xfff) * 0x10, puVar8 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar8 + 8) == uVar2 >> 0xc)) {
        uVar10 = *(undefined4 *)(puVar8 + 4);
      }
      (**(code **)(*(int *)(this + 0x1a3c) + 0x84))(this + 0x1a3c,uVar10);
      *(undefined4 *)(this + 0x1da0) = 0xbf800000;
      *(undefined4 *)(this + 0x1da4) = 0;
    }
  }
  pCVar6 = *(CStudioHdr **)(this + 0x13e0);
  fVar11 = *(float *)(this + 0x1d94);
  iVar3 = *(int *)(this + 0x1d9c);
  if (pCVar6 == (CStudioHdr *)0x0) {
    iVar5 = CBaseEntity::GetModel((CBaseEntity *)this);
    if (iVar5 == 0) {
      pCVar6 = *(CStudioHdr **)(this + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)this);
      pCVar6 = *(CStudioHdr **)(this + 0x13e0);
    }
    pCVar9 = (CStudioHdr *)0x0;
    if (pCVar6 == (CStudioHdr *)0x0) goto LAB_00a48ec3;
  }
  pCVar9 = (CStudioHdr *)0x0;
  if (*(int *)pCVar6 != 0) {
    pCVar9 = pCVar6;
  }
LAB_00a48ec3:
  CBaseAnimating::SetPoseParameter((CBaseAnimating *)this,pCVar9,iVar3,fVar11);
  if (*(int *)(TheDirector + 0x1bc) < 2) {
    fVar11 = *(float *)(ZombieWitchThreatNormalRange._28_4_ + 0x2c);
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    pCVar4 = (CNavArea *)(**(code **)(*(int *)this + 0x52c))(this);
  }
  else {
    if (((byte)this[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
    }
    pCVar4 = (CNavArea *)(**(code **)(*(int *)this + 0x52c))(this);
    fVar11 = 120.0;
  }
  SearchSurroundingAreas<MarkAsDamagingScan>(pCVar4,(Vector *)(this + 0x2e0),local_1d,fVar11,0,-1);
  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)