L L4D2node

ForEachTerrorPlayer<HitAnnouncement>

0x009e91c0 · 501 bytes · __cdecl

_Z19ForEachTerrorPlayerI15HitAnnouncementEbRT_

Decompiled

bool (1 param)

/* bool ForEachTerrorPlayer<HitAnnouncement>(HitAnnouncement&) */

bool ForEachTerrorPlayer<HitAnnouncement>(HitAnnouncement *param_1)

{
  char cVar1;
  CBasePlayer *this;
  int iVar2;
  int iVar3;
  undefined **local_3c [11];
  
  iVar3 = 1;
  if (*(int *)(gpGlobals + 0x14) < 1) {
    return true;
  }
  do {
    while ((this = (CBasePlayer *)UTIL_PlayerByIndex(iVar3), this == (CBasePlayer *)0x0 ||
           (*(int *)(this + 0x30) == 0))) {
LAB_009e9210:
      iVar3 = iVar3 + 1;
      if (*(int *)(gpGlobals + 0x14) < iVar3) {
        return true;
      }
    }
    if (*(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 != 0) {
      cVar1 = (**(code **)(*(int *)this + 0x16c))(this);
      if ((((cVar1 != '\0') && (*(int *)(this + 0x1f6c) != 2)) &&
          (cVar1 = (**(code **)(*(int *)this + 0x778))(this), cVar1 == '\0')) &&
         (cVar1 = CBasePlayer::IsSplitScreenPlayer(this), cVar1 == '\0')) {
        if ((param_1[0x14] == (HitAnnouncement)0x0) && (6 < *(int *)param_1)) {
          if (*(int *)param_1 < 0xf) {
            iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
            if (iVar2 != 3) goto LAB_009e9210;
            if (*(int *)param_1 < 0xf) goto LAB_009e928f;
          }
          iVar2 = CBaseEntity::GetTeamNumber((CBaseEntity *)this);
          if (iVar2 != 2) goto LAB_009e9210;
        }
LAB_009e928f:
        if ((*(int *)(param_1 + 8) != 0) && (*(int *)(param_1 + 4) != 0)) {
          CRecipientFilter::CRecipientFilter((CRecipientFilter *)local_3c);
          local_3c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
                    /* try { // try from 009e92c1 to 009e92c5 has its CatchHandler @ 009e93e1 */
          CRecipientFilter::AddRecipient((CRecipientFilter *)local_3c,this);
                    /* try { // try from 009e92cc to 009e9371 has its CatchHandler @ 009e93c5 */
          CRecipientFilter::MakeReliable((CRecipientFilter *)local_3c);
          UserMessageBegin((IRecipientFilter *)local_3c,"PZDmgMsg");
          MessageWriteByte(*(int *)param_1);
          if (*(int *)(param_1 + 8) == 0) {
            iVar2 = 0;
          }
          else {
            iVar2 = (**(code **)(*engine + 0x40))
                              (engine,*(undefined4 *)(*(int *)(param_1 + 8) + 0x30));
          }
          MessageWriteShort(iVar2);
          if (*(int *)(param_1 + 4) == 0) {
            iVar2 = 0;
          }
          else {
            iVar2 = (**(code **)(*engine + 0x40))
                              (engine,*(undefined4 *)(*(int *)(param_1 + 4) + 0x30));
          }
          MessageWriteShort(iVar2);
          if (*(int *)(param_1 + 0xc) == 0) {
            iVar2 = 0;
          }
          else {
            iVar2 = (**(code **)(*engine + 0x40))
                              (engine,*(undefined4 *)(*(int *)(param_1 + 0xc) + 0x30));
          }
          MessageWriteShort(iVar2);
          MessageWriteShort(*(int *)(param_1 + 0x10));
          MessageEnd();
          local_3c[0] = &PTR__CSingleUserRecipientFilter_00c08ea8;
          CRecipientFilter::~CRecipientFilter((CRecipientFilter *)local_3c);
        }
      }
      goto LAB_009e9210;
    }
    iVar3 = iVar3 + 1;
    if (*(int *)(gpGlobals + 0x14) < iVar3) {
      return true;
    }
  } while( true );
}

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)