L L4D2node

ForEachPlayer<ElevatorPlayerCollector>

0x006bfa70 · 739 bytes · __cdecl

_Z13ForEachPlayerI23ElevatorPlayerCollectorEbRT_

Decompiled

bool (1 param)

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

bool ForEachPlayer<ElevatorPlayerCollector>(ElevatorPlayerCollector *param_1)

{
  float fVar1;
  CBasePlayer *pCVar2;
  char cVar3;
  CBaseEntity *this;
  int iVar4;
  int iVar5;
  CBasePlayer *local_38;
  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<ElevatorPlayerCollector>(ElevatorPlayerCollector&)::tm_fmt,"(%s)%s",
               "Unaccounted","ForEachPlayer");
    local_20 = ___atan2f_finite;
  }
  iVar5 = _DAT_0105db00;
  local_28 = local_34;
  local_24 = local_30;
                    /* try { // try from 006bfcbe to 006bfd0c has its CatchHandler @ 006bfd85 */
  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 {
                    /* try { // try from 006bfb43 to 006bfbb8 has its CatchHandler @ 006bfd64 */
      this = (CBaseEntity *)UTIL_PlayerByIndex(iVar5);
      if (((this != (CBaseEntity *)0x0) && (*(int *)(this + 0x30) != 0)) &&
         ((*(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 != 0 &&
          ((cVar3 = (**(code **)(*(int *)this + 0x16c))(this), cVar3 != '\0' &&
           (*(int *)(this + 0x1f6c) != 2)))))) {
        local_38 = (CBasePlayer *)this;
        iVar4 = CBaseEntity::GetTeamNumber(this);
        if ((iVar4 == *(int *)(param_1 + 0x18)) || (*(int *)(param_1 + 0x18) == 0)) {
          cVar3 = CFuncElevator::IsPlayerOnElevator(*(CFuncElevator **)(param_1 + 0x14),local_38);
          pCVar2 = local_38;
          if (cVar3 == '\0') {
            if (((byte)*(CBaseEntity *)(local_38 + 0x14d) & 8) != 0) {
                    /* try { // try from 006bfd35 to 006bfd5e has its CatchHandler @ 006bfd64 */
              CBaseEntity::CalcAbsolutePosition((CBaseEntity *)local_38);
            }
            fVar1 = *(float *)(pCVar2 + 0x2e0);
            if (((((fVar1 < *(float *)(param_1 + 0x1c)) ||
                  (*(float *)(param_1 + 0x28) <= fVar1 && fVar1 != *(float *)(param_1 + 0x28))) ||
                 (fVar1 = *(float *)(pCVar2 + 0x2e4), fVar1 < *(float *)(param_1 + 0x20))) ||
                ((*(float *)(param_1 + 0x2c) <= fVar1 && fVar1 != *(float *)(param_1 + 0x2c) ||
                 (fVar1 = *(float *)(pCVar2 + 0x2e8), fVar1 < *(float *)(param_1 + 0x24))))) ||
               (*(float *)(param_1 + 0x30) <= fVar1 && fVar1 != *(float *)(param_1 + 0x30)))
            goto LAB_006bfc15;
          }
          CUtlVector<CBasePlayer*,CUtlMemory<CBasePlayer*,int>>::InsertBefore
                    ((CUtlVector<CBasePlayer*,CUtlMemory<CBasePlayer*,int>> *)param_1,
                     *(int *)(param_1 + 0xc),&local_38);
        }
      }
LAB_006bfc15:
      iVar5 = iVar5 + 1;
    } while (iVar5 <= *(int *)(gpGlobals + 0x14));
  }
  iVar5 = _DAT_0105db00;
  if (((DAT_0105d158 == '\0') || (_DAT_0105d154 != 0)) &&
     (iVar4 = ThreadGetCurrentId(), iVar5 == iVar4)) {
    cVar3 = CVProfNode::ExitScope();
    if (cVar3 != '\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 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)