L L4D2node

ForEachPlayer<CauseNearbyCoughing>

0x009089e0 · 1213 bytes · __cdecl

_Z13ForEachPlayerI19CauseNearbyCoughingEbRT_

Decompiled

bool (1 param)

/* WARNING: Globals starting with '_' overlap smaller symbols at the same address */
/* bool ForEachPlayer<CauseNearbyCoughing>(CauseNearbyCoughing&) */

bool ForEachPlayer<CauseNearbyCoughing>(CauseNearbyCoughing *param_1)

{
  float fVar1;
  code *pcVar2;
  int iVar3;
  char cVar4;
  int *piVar5;
  int iVar6;
  int iVar7;
  int *piVar8;
  int *piVar9;
  int iVar10;
  float local_f4;
  float local_f0;
  float local_ec;
  float local_e8;
  float local_e4;
  float local_e0;
  undefined **local_dc [4];
  float local_cc;
  float local_c8;
  float local_c4;
  float local_bc;
  float local_b8;
  float local_b4;
  undefined4 local_ac;
  undefined4 local_a8;
  undefined4 local_a4;
  undefined4 local_9c;
  undefined4 local_98;
  undefined4 local_94;
  undefined4 local_8c;
  undefined1 local_88;
  undefined1 local_87;
  undefined1 local_70 [12];
  undefined1 local_64 [32];
  float local_44;
  char local_3a;
  char local_39;
  
  if (___atan2f_finite == 0) {
    iVar10 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))();
    iVar10 = ___atan2f_finite;
  }
  iVar7 = _DAT_0105db00;
                    /* try { // try from 00908b96 to 00908be4 has its CatchHandler @ 00908f44 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar6 = ThreadGetCurrentId(), iVar7 == iVar6)) {
    if ((char *)*_DAT_0105d15c != "ForEachPlayer") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc0d94f,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  piVar8 = (int *)&stack0xfffffec4;
  if (0 < *(int *)(gpGlobals + 0x14)) {
    iVar7 = 1;
    piVar9 = (int *)&stack0xfffffec4;
    do {
      while( true ) {
        *piVar9 = iVar7;
        piVar9[-1] = 0x908b05;
        piVar5 = (int *)UTIL_PlayerByIndex(*piVar9);
        piVar8 = piVar9;
        if ((piVar5 != (int *)0x0) && (piVar5[0xc] != 0)) break;
LAB_00908af0:
        iVar7 = iVar7 + 1;
        piVar9 = piVar8;
        if (*(int *)(gpGlobals + 0x14) < iVar7) goto LAB_00908b2c;
      }
      if (piVar5[0xc] - *(int *)(gpGlobals + 0x58) >> 4 != 0) {
        iVar6 = *piVar5;
        *piVar9 = (int)piVar5;
                    /* try { // try from 00908ac5 to 00908b04 has its CatchHandler @ 00908eb7 */
        pcVar2 = *(code **)(iVar6 + 0x16c);
        piVar9[-1] = 0x908acb;
        cVar4 = (*pcVar2)();
        if ((cVar4 != '\0') && (piVar5[0x7db] != 2)) {
          iVar6 = *piVar5;
          *piVar9 = (int)piVar5;
          pcVar2 = *(code **)(iVar6 + 300);
          piVar9[-1] = 0x908ae3;
          cVar4 = (*pcVar2)();
          if (cVar4 != '\0') {
            *piVar9 = (int)piVar5;
                    /* try { // try from 00908c43 to 00908e96 has its CatchHandler @ 00908eb7 */
            piVar9[-1] = 0x908c48;
            iVar6 = CBaseEntity::GetTeamNumber((CBaseEntity *)*piVar9);
            *piVar9 = iVar6;
            piVar9[-1] = 0x908c50;
            cVar4 = IsASurvivorTeam(iVar6);
            if (cVar4 != '\0') {
              fVar1 = *(float *)(ZombieCoughCloudRadius._28_4_ + 0x2c);
              iVar6 = *piVar5;
              piVar9[1] = (int)piVar5;
              *piVar9 = (int)&local_e8;
              pcVar2 = *(code **)(iVar6 + 0x234);
              piVar9[-1] = 0x908c7f;
              (*pcVar2)();
              piVar8 = piVar9 + -1;
              if ((local_e8 - *(float *)param_1) * (local_e8 - *(float *)param_1) +
                  (local_e4 - *(float *)(param_1 + 4)) * (local_e4 - *(float *)(param_1 + 4)) +
                  (local_e0 - *(float *)(param_1 + 8)) * (local_e0 - *(float *)(param_1 + 8)) <
                  fVar1 * fVar1) {
                piVar9[2] = 0;
                piVar9[1] = 0;
                *piVar9 = 0;
                piVar9[-1] = (int)local_dc;
                piVar9[-2] = 0x908cfd;
                CTraceFilterSimple::CTraceFilterSimple
                          ((CTraceFilterSimple *)piVar9[-1],(IHandleEntity *)*piVar9,piVar9[1],
                           (_func_bool_IHandleEntity_ptr_int *)piVar9[2]);
                local_dc[0] = &PTR_ShouldHitEntity_00c54558;
                iVar6 = *piVar5;
                *piVar9 = (int)piVar5;
                piVar9[-1] = (int)&local_f4;
                pcVar2 = *(code **)(iVar6 + 0x234);
                piVar9[-2] = 0x908d1c;
                (*pcVar2)();
                local_88 = 1;
                local_8c = 0;
                local_c8 = local_f0;
                local_c4 = local_ec;
                local_cc = local_f4;
                local_b8 = *(float *)(param_1 + 4) - local_f0;
                local_b4 = *(float *)(param_1 + 8) - local_ec;
                local_bc = *(float *)param_1 - local_f4;
                local_94 = 0;
                local_98 = 0;
                local_9c = 0;
                local_87 = local_b8 * local_b8 + local_b4 * local_b4 + local_bc * local_bc != 0.0;
                local_a4 = 0;
                local_a8 = 0;
                local_ac = 0;
                iVar6 = *enginetrace;
                piVar9[2] = (int)local_70;
                piVar9[1] = (int)local_dc;
                *piVar9 = 0x200400b;
                piVar9[-1] = (int)&local_cc;
                piVar9[-2] = (int)enginetrace;
                pcVar2 = *(code **)(iVar6 + 0x14);
                piVar9[-3] = 0x908e16;
                (*pcVar2)();
                if (*(int *)(r_visualizetraces._28_4_ + 0x30) != 0) {
                  piVar9[4] = -0x40800000;
                  piVar9[-1] = (int)local_64;
                  piVar9[3] = 1;
                  piVar9[2] = 0;
                  piVar9[1] = 0;
                  *piVar9 = 0xff;
                  piVar9[-2] = (int)local_70;
                  piVar9[-3] = 0x908e5c;
                  DebugDrawLine((Vector *)piVar9[-2],(Vector *)piVar9[-1],*piVar9,piVar9[1],
                                piVar9[2],SUB41(piVar9[3],0),(float)piVar9[4]);
                }
                piVar8 = piVar9 + -2;
                if (((1.0 <= local_44) && (piVar8 = piVar9 + -2, local_3a == '\0')) &&
                   (piVar8 = piVar9 + -2, local_39 == '\0')) {
                  iVar6 = *piVar5;
                  iVar3 = *(int *)(param_1 + 0xc);
                  piVar9[-2] = (int)piVar5;
                  piVar9[-1] = iVar3;
                  pcVar2 = *(code **)(iVar6 + 0x590);
                  piVar9[-3] = 0x908e97;
                  (*pcVar2)();
                  piVar8 = piVar9 + -2;
                }
              }
            }
          }
        }
        goto LAB_00908af0;
      }
      iVar7 = iVar7 + 1;
    } while (iVar7 <= *(int *)(gpGlobals + 0x14));
  }
LAB_00908b2c:
  iVar7 = _DAT_0105db00;
  if ((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) {
    piVar8[-1] = 0x908c03;
    iVar6 = ThreadGetCurrentId();
    if (iVar7 == iVar6) {
      *piVar8 = (int)_DAT_0105d15c;
      piVar8[-1] = 0x908c18;
      cVar4 = CVProfNode::ExitScope();
      if (cVar4 != '\0') {
        _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
      }
      DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
    }
  }
  if (iVar10 != 0) {
    piVar8[5] = 0;
    piVar8[4] = 0;
    piVar8[3] = 0;
    *piVar8 = iVar10;
    piVar8[1] = 0;
    piVar8[2] = 0;
    pcVar2 = *(code **)(iVar10 + 0x54);
    piVar8[-1] = 0x908b7d;
    (*pcVar2)();
  }
  return 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)