L L4D2node

WitchSlashEnumerator::EnumElement

0x00a496f0 · 1215 bytes · __thiscall

_ZN20WitchSlashEnumerator11EnumElementEP13IHandleEntity

Decompiled

undefined (2 params)

/* WitchSlashEnumerator::EnumElement(IHandleEntity*) */

undefined4 __thiscall
WitchSlashEnumerator::EnumElement(WitchSlashEnumerator *this,IHandleEntity *param_1)

{
  uint uVar1;
  char cVar2;
  uint *puVar3;
  CBaseEntity *this_00;
  int iVar4;
  float *pfVar5;
  int *piVar6;
  undefined4 *puVar7;
  Vector *pVVar8;
  CBasePropDoor *this_01;
  int iVar9;
  CBaseEntity *pCVar10;
  float fVar11;
  float local_94;
  float local_90;
  float local_8c;
  float local_88;
  float local_84;
  float local_80;
  undefined **local_7c [18];
  uint local_34;
  
  puVar3 = (uint *)(**(code **)(*(int *)param_1 + 0xc))(param_1);
  uVar1 = *puVar3;
  if (uVar1 == 0xffffffff) {
    return 0;
  }
  iVar9 = (uVar1 & 0xfff) * 0x10;
  if (*(uint *)(gEntList + iVar9 + 8) != uVar1 >> 0xc) {
    return 0;
  }
  piVar6 = *(int **)(gEntList + iVar9 + 4);
  if (piVar6 == (int *)0x0) {
    return 0;
  }
  this_00 = (CBaseEntity *)(**(code **)(*piVar6 + 0x18))(piVar6);
  if (this_00 == (CBaseEntity *)0x0) {
    return 0;
  }
  if (*(CBaseEntity **)(this + 4) == this_00) {
    return 0;
  }
  cVar2 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
  if (cVar2 != '\0') {
    if (*(int *)(this + 8) == 0) {
      return 0;
    }
    if (*(int *)(this_00 + 0x30) == 0) {
      iVar9 = 0;
    }
    else {
      iVar9 = *(int *)(this_00 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4;
    }
    iVar4 = *(int *)(*(int *)(this + 8) + 0x30);
    if (iVar4 == 0) {
      iVar4 = 0;
    }
    else {
      iVar4 = iVar4 - *(int *)(gpGlobals + 0x58) >> 4;
    }
    if (iVar9 != iVar4) {
      return 0;
    }
    cVar2 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
    pCVar10 = (CBaseEntity *)0x0;
    if (cVar2 != '\0') {
      pCVar10 = this_00;
    }
    cVar2 = (**(code **)(*(int *)pCVar10 + 0x7e8))(pCVar10);
    if (cVar2 != '\0') {
      return 0;
    }
    pfVar5 = (float *)(**(code **)(**(int **)(this + 4) + 0x288))(*(int **)(this + 4));
    if (((byte)this_00[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(this_00);
    }
    if ((*(float *)(this_00 + 0x2e4) - pfVar5[1]) * *(float *)(this + 0x10) +
        (*(float *)(this_00 + 0x2e0) - *pfVar5) * *(float *)(this + 0xc) +
        (*(float *)(this_00 + 0x2e8) - pfVar5[2]) * *(float *)(this + 0x14) < 0.0) {
      return 0;
    }
  }
  cVar2 = (**(code **)(*(int *)(*(int *)(this + 4) + 0x1a3c) + 0x114))
                    (*(int *)(this + 4) + 0x1a3c,this_00,
                     *(undefined4 *)(ZombieWitchAttackRange._28_4_ + 0x2c));
  if (cVar2 == '\0') {
    return 0;
  }
  piVar6 = (int *)(**(code **)(**(int **)(this + 4) + 0x59c))(*(int **)(this + 4));
  cVar2 = (**(code **)(*piVar6 + 0xf8))(piVar6,this_00,0);
  if (cVar2 != '\0') {
    iVar9 = (**(code **)(*(int *)this_00 + 0x144))(this_00);
    if (iVar9 == 0) {
      if ((((*(char **)(this_00 + 0x7c) == "func_door_rotating") ||
           (cVar2 = CBaseEntity::ClassMatchesComplex(this_00,"func_door_rotating"), cVar2 != '\0'))
          || (*(char **)(this_00 + 0x7c) == "prop_door*")) ||
         (cVar2 = CBaseEntity::ClassMatchesComplex(this_00,"prop_door*"), cVar2 != '\0')) {
        this_01 = (CBasePropDoor *)
                  __dynamic_cast(this_00,&CBaseEntity::typeinfo,&CBasePropDoor::typeinfo,0);
        if (this_01 == (CBasePropDoor *)0x0) {
          CBaseEntity::EmitSound(this_00,"WoodenDoor.Pound",0.0,(float *)0x0);
          fVar11 = 1000.0;
        }
        else {
          CBasePropDoor::OnInfectedAttack(this_01);
          fVar11 = 1000.0;
        }
      }
      else {
        CBaseEntity::EmitSound(*(CBaseEntity **)(this + 4),"Zombie.ClawScrape",0.0,(float *)0x0);
        fVar11 = 100.0;
      }
    }
    else {
      iVar9 = CBaseEntity::GetTeamNumber(this_00);
      cVar2 = IsASurvivorTeam(iVar9);
      if (cVar2 != '\0') {
        if (this[0x19] != (WitchSlashEnumerator)0x0) {
          return 0;
        }
        cVar2 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
        if (cVar2 != '\0') {
          piVar6 = *(int **)(this + 4);
          if (piVar6 == (int *)0x0) {
            *(undefined4 *)(this_00 + 0x4020) = 0xffffffff;
          }
          else {
            puVar7 = (undefined4 *)(**(code **)(*piVar6 + 0xc))(piVar6);
            *(undefined4 *)(this_00 + 0x4020) = *puVar7;
          }
        }
        this[0x19] = (WitchSlashEnumerator)0x1;
      }
      CBaseEntity::EmitSound(this_00,"WitchZombie.ShredVictim",0.0,(float *)0x0);
      pVVar8 = (Vector *)(**(code **)(**(int **)(this + 4) + 0x288))(*(int **)(this + 4));
      CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_7c);
      local_7c[0] = &PTR__CPVSFilter_00c09bc8;
                    /* try { // try from 00a4993b to 00a4993f has its CatchHandler @ 00a49be3 */
      CRecipientFilter::AddRecipientsByPVS((CRecipientFilter *)local_7c,pVVar8);
                    /* try { // try from 00a49943 to 00a49972 has its CatchHandler @ 00a49bca */
      CRecipientFilter::MakeReliable((CRecipientFilter *)local_7c);
      UserMessageBegin((IRecipientFilter *)local_7c,"WitchBloodSplatter");
      pVVar8 = (Vector *)(**(code **)(**(int **)(this + 4) + 0x288))(*(int **)(this + 4));
      MessageWriteVec3Coord(pVVar8);
      MessageEnd();
      local_7c[0] = &PTR__CPVSFilter_00c09bc8;
      CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_7c);
      fVar11 = 100.0;
    }
    CTakeDamageInfo::CTakeDamageInfo
              ((CTakeDamageInfo *)local_7c,*(CBaseEntity **)(this + 4),*(CBaseEntity **)(this + 4),
               fVar11,4,0);
    if ((*(int *)(ZombieWitchAlwaysKills._28_4_ + 0x30) != 0) &&
       (iVar9 = GetDifficulty(), iVar9 != 0)) {
      local_34 = local_34 | 0x8000;
    }
    (**(code **)(**(int **)(this + 4) + 0x234))(&local_88,*(int **)(this + 4));
    pfVar5 = (float *)(**(code **)(*(int *)this_00 + 0x288))(this_00);
    local_94 = *pfVar5 - local_88;
    local_90 = pfVar5[1] - local_84;
    local_8c = pfVar5[2] - local_80;
    VectorNormalize((Vector *)&local_94);
    (**(code **)(**(int **)(this + 4) + 0x234))(&local_88,*(int **)(this + 4));
    CalculateMeleeDamageForce
              ((CTakeDamageInfo *)local_7c,(Vector *)&local_94,(Vector *)&local_88,1.0);
    CBaseEntity::TakeDamage(this_00,(CTakeDamageInfo *)local_7c);
    this[0x18] = (WitchSlashEnumerator)0x1;
    return 0;
  }
  return 0;
}

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)