L L4D2node

ForEachPlayer<TestDistance>

0x0088f580 · 647 bytes · __cdecl

_Z13ForEachPlayerI12TestDistanceEbRT_

Decompiled

bool (1 param)

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

bool ForEachPlayer<TestDistance>(TestDistance *param_1)

{
  char cVar1;
  int *piVar2;
  float *pfVar3;
  int iVar4;
  int iVar5;
  bool bVar6;
  undefined4 local_34;
  undefined4 local_30;
  undefined4 local_28;
  undefined4 local_24;
  int local_20;
  
  local_34 = 0;
  local_30 = 0;
  if (___atan2f_finite == 0) {
    local_20 = 0;
  }
  else {
    (**(code **)(___atan2f_finite + 0x50))
              (___atan2f_finite,&local_34,0,0,0,0,"/data/src/game/server/player.h",0x595,
               &ForEachPlayer<TestDistance>(TestDistance&)::tm_fmt,"(%s)%s","Unaccounted",
               "ForEachPlayer");
    local_20 = ___atan2f_finite;
  }
  iVar5 = _DAT_0105db00;
  local_28 = local_34;
  local_24 = local_30;
                    /* try { // try from 0088f716 to 0088f764 has its CatchHandler @ 0088f836 */
  if (((_DAT_0105d154 != 0) || (DAT_0105d158 == '\0')) &&
     (iVar4 = ThreadGetCurrentId(), iVar5 == iVar4)) {
    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)) {
    iVar5 = 1;
    do {
      while ((piVar2 = (int *)UTIL_PlayerByIndex(iVar5), piVar2 == (int *)0x0 || (piVar2[0xc] == 0))
            ) {
LAB_0088f678:
        iVar5 = iVar5 + 1;
        if (*(int *)(gpGlobals + 0x14) < iVar5) goto LAB_0088f6b4;
      }
      if (piVar2[0xc] - *(int *)(gpGlobals + 0x58) >> 4 != 0) {
                    /* try { // try from 0088f64d to 0088f68c has its CatchHandler @ 0088f815 */
        cVar1 = (**(code **)(*piVar2 + 0x16c))(piVar2);
                    /* try { // try from 0088f77d to 0088f782 has its CatchHandler @ 0088f815 */
        if (((cVar1 == '\0') || (piVar2[0x7db] == 2)) ||
           ((cVar1 = (**(code **)(*piVar2 + 0x778))(piVar2), cVar1 != '\0' ||
            (pfVar3 = (float *)(**(code **)(*piVar2 + 0x288))(piVar2),
            *(float *)(param_1 + 0xc) <=
            (*(float *)(param_1 + 4) - pfVar3[1]) * (*(float *)(param_1 + 4) - pfVar3[1]) +
            (*(float *)(param_1 + 8) - pfVar3[2]) * (*(float *)(param_1 + 8) - pfVar3[2]) +
            (*(float *)param_1 - *pfVar3) * (*(float *)param_1 - *pfVar3))))) goto LAB_0088f678;
        bVar6 = false;
        goto LAB_0088f6b9;
      }
      iVar5 = iVar5 + 1;
    } while (iVar5 <= *(int *)(gpGlobals + 0x14));
  }
LAB_0088f6b4:
  bVar6 = true;
LAB_0088f6b9:
  iVar5 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar4 = ThreadGetCurrentId(), iVar5 == iVar4)) {
    cVar1 = CVProfNode::ExitScope();
    if (cVar1 != '\0') {
      _DAT_0105d15c = (int *)_DAT_0105d15c[0x19];
    }
    DAT_0105d158 = _DAT_0105d15c == (int *)0x105d160;
  }
  if (local_20 != 0) {
    (**(code **)(local_20 + 0x54))(local_20,local_28,local_24,0,0,0);
  }
  return bVar6;
}

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)