L L4D2node

ForEachPlayer<TestInViewCone>

0x0088f0f0 · 1102 bytes · __cdecl

_Z13ForEachPlayerI14TestInViewConeEbRT_

Decompiled

bool (1 param)

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

bool ForEachPlayer<TestInViewCone>(TestInViewCone *param_1)

{
  code *pcVar1;
  float fVar2;
  float fVar3;
  char cVar4;
  int *piVar5;
  int iVar6;
  int iVar7;
  int iVar8;
  int *piVar9;
  int *piVar10;
  bool bVar12;
  float fVar13;
  float fVar14;
  float fVar15;
  float fVar16;
  float fVar17;
  double dVar18;
  int iStackY_c8;
  undefined8 local_c4;
  float local_4c;
  float local_48;
  float local_44;
  float local_40;
  float local_3c;
  float local_38;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  int *piVar11;
  
  piVar9 = (int *)&stack0xffffff44;
  if (___atan2f_finite == 0) {
    iVar7 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))();
    iVar7 = ___atan2f_finite;
  }
  iVar8 = _DAT_0105db00;
                    /* try { // try from 0088f2ae to 0088f2fc has its CatchHandler @ 0088f54c */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar6 = ThreadGetCurrentId(), iVar8 == iVar6)) {
    if ((char *)*_DAT_0105d15c != "ForEachPlayer") {
      _DAT_0105d15c =
           (int *)CVProfNode::GetSubNode((char *)_DAT_0105d15c,0xc0d94f,(char *)0x1,0xbfafa1);
    }
    CVProfNode::EnterScope();
    DAT_0105d158 = '\0';
  }
  if (0 < *(int *)(gpGlobals + 0x14)) {
    iVar8 = 1;
    piVar9 = (int *)&stack0xffffff44;
LAB_0088f208:
    *piVar9 = iVar8;
    piVar9[-1] = 0x88f210;
    piVar5 = (int *)UTIL_PlayerByIndex(*piVar9);
    if ((piVar5 != (int *)0x0) && (piVar5[0xc] != 0)) {
      if (piVar5[0xc] - *(int *)(gpGlobals + 0x58) >> 4 == 0) {
        iVar8 = iVar8 + 1;
        if (*(int *)(gpGlobals + 0x14) < iVar8) goto LAB_0088f23f;
        goto LAB_0088f208;
      }
      iVar6 = *piVar5;
      *piVar9 = (int)piVar5;
                    /* try { // try from 0088f1c5 to 0088f20f has its CatchHandler @ 0088f561 */
      pcVar1 = *(code **)(iVar6 + 0x16c);
      piVar9[-1] = 0x88f1cb;
      cVar4 = (*pcVar1)();
      if ((cVar4 != '\0') && (piVar5[0x7db] != 2)) {
        iVar6 = *piVar5;
        *piVar9 = (int)piVar5;
        pcVar1 = *(code **)(iVar6 + 0x778);
        piVar9[-1] = 0x88f1eb;
        cVar4 = (*pcVar1)();
        if (cVar4 != '\0') goto LAB_0088f200;
        iVar6 = *piVar5;
        piVar9[1] = (int)piVar5;
        *piVar9 = (int)&local_28;
        pcVar1 = *(code **)(iVar6 + 0x234);
        piVar9[-1] = 0x88f3ea;
        (*pcVar1)();
        iVar6 = *piVar5;
        *piVar9 = (int)piVar5;
        piVar9[-1] = (int)&local_34;
        pcVar1 = *(code **)(iVar6 + 0x3fc);
        piVar9[-2] = 0x88f3ff;
        (*pcVar1)();
        fVar3 = local_2c;
        fVar2 = local_30;
        fVar13 = local_34;
        piVar10 = piVar9 + -2;
        piVar11 = piVar9 + -2;
        piVar9[1] = (int)&local_4c;
        *piVar9 = (int)&local_40;
        local_40 = local_28 + local_34;
        piVar9[-1] = (int)&local_28;
        piVar9[2] = 0;
        local_3c = local_24 + local_30;
        piVar9[-2] = (int)param_1;
        local_38 = local_20 + local_2c;
        piVar9[-3] = 0x88f472;
        CalcClosestPointOnLine
                  ((Vector *)piVar9[-2],(Vector *)piVar9[-1],(Vector *)*piVar9,(Vector *)piVar9[1],
                   (float *)piVar9[2]);
        if (*(float *)(param_1 + 0xc) <=
            (local_48 - local_24) * (local_48 - local_24) +
            (local_44 - local_20) * (local_44 - local_20) +
            (local_4c - local_28) * (local_4c - local_28)) {
          piVar9[-2] = (int)piVar5;
                    /* try { // try from 0088f30c to 0088f471 has its CatchHandler @ 0088f561 */
          piVar9[-3] = 0x88f311;
          iVar6 = CBasePlayer::GetFOV((CBasePlayer *)piVar9[-2]);
          *(double *)(piVar9 + -2) = (double)((float)iVar6 * 0.5) * 0.017453292519943295;
          piVar9[-3] = 0x88f335;
          dVar18 = cos(*(double *)(piVar9 + -2));
          fVar15 = local_4c - local_28;
          fVar17 = (float)dVar18;
          fVar16 = local_48 - local_24;
          fVar14 = local_44 - local_20;
          fVar13 = fVar2 * fVar16 + fVar13 * fVar15 + fVar3 * fVar14;
          if (fVar17 <= 0.0) {
            if (0.0 < fVar13) goto LAB_0088f4b1;
            bVar12 = fVar13 * fVar13 <=
                     fVar17 * fVar17 * (fVar14 * fVar14 + fVar16 * fVar16 + fVar15 * fVar15);
          }
          else {
            piVar9 = piVar9 + -2;
            if (fVar13 < 0.0) goto LAB_0088f200;
            bVar12 = fVar17 * fVar17 * (fVar16 * fVar16 + fVar15 * fVar15 + fVar14 * fVar14) <=
                     fVar13 * fVar13;
          }
          piVar9 = piVar11;
          if (!bVar12) goto LAB_0088f200;
        }
LAB_0088f4b1:
        bVar12 = false;
        iVar8 = _DAT_0105db00;
        piVar9 = piVar10;
        goto joined_r0x0088f4b8;
      }
    }
LAB_0088f200:
    iVar8 = iVar8 + 1;
    if (*(int *)(gpGlobals + 0x14) < iVar8) goto LAB_0088f23f;
    goto LAB_0088f208;
  }
LAB_0088f23f:
  bVar12 = true;
  iVar8 = _DAT_0105db00;
joined_r0x0088f4b8:
  _DAT_0105db00 = iVar8;
  if (DAT_0105d158 == '\0') {
    piVar9[-1] = 0x88f25c;
    iVar6 = ThreadGetCurrentId();
  }
  else {
    if (_DAT_0105d154 == 0) goto LAB_0088f268;
    piVar9[-1] = 0x88f4d8;
    iVar6 = ThreadGetCurrentId();
  }
  if (iVar8 == iVar6) {
    *piVar9 = (int)_DAT_0105d15c;
    piVar9[-1] = 0x88f4fa;
    cVar4 = CVProfNode::ExitScope();
    if (cVar4 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
LAB_0088f268:
  if (iVar7 != 0) {
    piVar9[5] = 0;
    piVar9[4] = 0;
    piVar9[3] = 0;
    *piVar9 = iVar7;
    piVar9[1] = 0;
    piVar9[2] = 0;
    pcVar1 = *(code **)(iVar7 + 0x54);
    piVar9[-1] = 0x88f29b;
    (*pcVar1)();
  }
  return bVar12;
}

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)