L L4D2node

ForEachTerrorPlayer<FindUsedTeamDesiredSurvivorSlots>

0x009ea4c0 · 224 bytes · __cdecl

_Z19ForEachTerrorPlayerI32FindUsedTeamDesiredSurvivorSlotsEbRT_

Decompiled

bool (1 param)

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

bool ForEachTerrorPlayer<FindUsedTeamDesiredSurvivorSlots>
               (FindUsedTeamDesiredSurvivorSlots *param_1)

{
  char cVar1;
  int *piVar2;
  KeyValues *pKVar3;
  int iVar4;
  int local_24;
  int local_20 [4];
  
  iVar4 = 1;
  if (0 < *(int *)(gpGlobals + 0x14)) {
    do {
      piVar2 = (int *)UTIL_PlayerByIndex(iVar4);
      if ((((piVar2 != (int *)0x0) && (piVar2[0xc] != 0)) &&
          (piVar2[0xc] - *(int *)(gpGlobals + 0x58) >> 4 != 0)) &&
         ((cVar1 = (**(code **)(*piVar2 + 0x16c))(piVar2), cVar1 != '\0' && (piVar2[0x7db] != 2))))
      {
        local_24 = 0;
        local_20[0] = 4;
        pKVar3 = (KeyValues *)CDirector::PlayerAvatarGet(TheDirector,(edict_t *)piVar2[0xc]);
        CDirector::PlayerAvatarUnpack
                  (TheDirector,pKVar3,&local_24,(SurvivorCharacterType *)local_20);
        if ((local_24 == 2) && (local_20[0] < 4)) {
          param_1[local_20[0]] = (FindUsedTeamDesiredSurvivorSlots)0x0;
        }
      }
      iVar4 = iVar4 + 1;
    } while (iVar4 <= *(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)