L L4D2node

ForEachTerrorPlayer<FindBotSpectator>

0x009e9550 · 358 bytes · __cdecl

_Z19ForEachTerrorPlayerI16FindBotSpectatorEbRT_

Decompiled

bool (1 param)

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

bool ForEachTerrorPlayer<FindBotSpectator>(FindBotSpectator *param_1)

{
  int iVar1;
  char cVar2;
  CBaseEntity *this;
  int iVar3;
  int iVar4;
  int iVar5;
  
  iVar5 = 1;
  if (0 < *(int *)(gpGlobals + 0x14)) {
    do {
      this = (CBaseEntity *)UTIL_PlayerByIndex(iVar5);
      if ((((this != (CBaseEntity *)0x0) && (*(int *)(this + 0x30) != 0)) &&
          (*(int *)(this + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 != 0)) &&
         ((cVar2 = (**(code **)(*(int *)this + 0x16c))(this), cVar2 != '\0' &&
          (*(int *)(this + 0x1f6c) != 2)))) {
        iVar3 = CBaseEntity::GetTeamNumber(this);
        if (iVar3 == 2) {
          iVar3 = __dynamic_cast(this,&CTerrorPlayer::typeinfo,&SurvivorBot::typeinfo,0);
          if ((iVar3 != 0) &&
             (iVar1 = *(int *)(iVar3 + 0x4308),
             iVar4 = (**(code **)(*engine + 0x40))
                               (engine,*(undefined4 *)(*(int *)(param_1 + 8) + 0x30)),
             iVar1 == iVar4)) {
            *(int *)param_1 = iVar3;
            return false;
          }
        }
        else {
          iVar3 = CBaseEntity::GetTeamNumber(this);
          if (((iVar3 == 3) &&
              (iVar3 = __dynamic_cast(this,&CTerrorPlayer::typeinfo,&BossZombiePlayerBot::typeinfo,0
                                     ), iVar3 != 0)) &&
             (iVar1 = *(int *)(iVar3 + 0x4304),
             iVar4 = (**(code **)(*engine + 0x40))
                               (engine,*(undefined4 *)(*(int *)(param_1 + 8) + 0x30)),
             iVar1 == iVar4)) {
            *(int *)(param_1 + 4) = iVar3;
            return false;
          }
        }
      }
      iVar5 = iVar5 + 1;
    } while (iVar5 <= *(int *)(gpGlobals + 0x14));
  }
  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)