L L4D2node

InfectedAttack::OnSound

0x00a287c0 · 602 bytes · __cdecl

_ZN14InfectedAttack7OnSoundEP8InfectedP11CBaseEntityRK6VectorP9KeyValues

Decompiled

undefined (4 params)

/* InfectedAttack::OnSound(Infected*, CBaseEntity*, Vector const&, KeyValues*) */

Infected *
InfectedAttack::OnSound(Infected *param_1,CBaseEntity *param_2,Vector *param_3,KeyValues *param_4)

{
  uint uVar1;
  char cVar2;
  KeyValues *this;
  char *pcVar3;
  int iVar4;
  undefined4 *puVar5;
  CBaseEntity *this_00;
  undefined4 uVar6;
  undefined *puVar7;
  KeyValues *in_stack_00000018;
  
  if ((((in_stack_00000018 == (KeyValues *)0x0) || (((byte)param_3[0x1c74] & 8) != 0)) ||
      (this = (KeyValues *)KeyValues::FindKey(in_stack_00000018,"Reaction",false),
      this == (KeyValues *)0x0)) ||
     ((((pcVar3 = (char *)KeyValues::GetString(this,(char *)0x0,""), pcVar3 != "SeekAndDestroy" &&
        (iVar4 = _V_stricmp("SeekAndDestroy",pcVar3), iVar4 != 0)) ||
       (cVar2 = (**(code **)(*(int *)(param_3 + 0x1a3c) + 0x114))
                          (param_3 + 0x1a3c,param_4,
                           *(undefined4 *)(ZombieForceAttackFromSoundRange._28_4_ + 0x2c)),
       cVar2 == '\0')) &&
      ((pcVar3 = (char *)KeyValues::GetString(this,(char *)0x0,""), pcVar3 != "ChaseFromAnywhere" &&
       (iVar4 = _V_stricmp("ChaseFromAnywhere",pcVar3), iVar4 != 0)))))) goto LAB_00a288c8;
  uVar1 = *(uint *)(param_4 + 0x180);
  if ((uVar1 != 0xffffffff) &&
     (((puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc &&
       (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) &&
      (*(CBaseEntity **)(puVar7 + 4) != (CBaseEntity *)0x0)))) {
    iVar4 = CBaseEntity::GetGender(*(CBaseEntity **)(puVar7 + 4));
    if (iVar4 != 0x10) {
      this_00 = (CBaseEntity *)0x0;
      uVar1 = *(uint *)(param_4 + 0x180);
      if (((uVar1 != 0xffffffff) &&
          (puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc)) &&
         (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)) {
        this_00 = *(CBaseEntity **)(puVar7 + 4);
      }
      iVar4 = CBaseEntity::GetGender(this_00);
      if (iVar4 != 0x11) goto LAB_00a288ab;
    }
    iVar4 = CBaseEntity::GetGender((CBaseEntity *)param_3);
    if ((iVar4 == 0x10) || (iVar4 = CBaseEntity::GetGender((CBaseEntity *)param_3), iVar4 == 0x11))
    goto LAB_00a288c8;
    uVar6 = 0;
    uVar1 = *(uint *)(param_4 + 0x180);
    if ((uVar1 != 0xffffffff) &&
       ((puVar7 = g_pEntityList + (uVar1 & 0xfff) * 0x10, puVar7 != (undefined *)0xfffffffc &&
        (*(uint *)(puVar7 + 8) == uVar1 >> 0xc)))) {
      uVar6 = *(undefined4 *)(puVar7 + 4);
    }
    cVar2 = (**(code **)(*(int *)param_3 + 0x42c))(param_3,uVar6,0);
    if (cVar2 == '\0') goto LAB_00a288c8;
  }
LAB_00a288ab:
  puVar5 = (undefined4 *)(**(code **)(*(int *)param_4 + 0xc))(param_4);
  *(undefined4 *)(param_2 + 0x34) = *puVar5;
LAB_00a288c8:
  *(undefined4 *)param_1 = 4;
  *(undefined4 *)(param_1 + 4) = 0;
  *(undefined4 *)(param_1 + 8) = 0;
  *(undefined4 *)(param_1 + 0xc) = 1;
  return param_1;
}

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)