L L4D2node

ForEachTerrorPlayer<BestRescuableSurvivor>

0x00890660 · 368 bytes · __cdecl

_Z19ForEachTerrorPlayerI21BestRescuableSurvivorEbRT_

Decompiled

bool (1 param)

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

bool ForEachTerrorPlayer<BestRescuableSurvivor>(BestRescuableSurvivor *param_1)

{
  int *piVar1;
  char cVar2;
  CBaseEntity *this;
  int iVar3;
  int iVar4;
  
  if (0 < *(int *)(gpGlobals + 0x14)) {
    iVar4 = 1;
    do {
      this = (CBaseEntity *)UTIL_PlayerByIndex(iVar4);
      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)))) &&
         ((cVar2 = (**(code **)(*(int *)this + 300))(this), cVar2 == '\0' &&
          (iVar3 = CBaseEntity::GetTeamNumber(this), iVar3 == 2)))) {
        if (*(int *)(param_1 + 0x10) < 1) {
LAB_00890720:
          if (this[0x30d4] == (CBaseEntity)0x0) {
            if (*(float *)(RescueMinDeadTime._28_4_ + 0x2c) <= 3.4028235e+38) {
LAB_0089074f:
              piVar1 = *(int **)param_1;
              if ((piVar1 == (int *)0x0) ||
                 (((cVar2 = (**(code **)(*piVar1 + 0x778))(piVar1), cVar2 != '\0' ||
                   (cVar2 = (**(code **)(*(int *)this + 0x778))(this), cVar2 == '\0')) &&
                  ((*(int *)param_1 == 0 ||
                   (*(float *)(gpGlobals + 0xc) - *(float *)(*(int *)param_1 + 0x340c) <
                    *(float *)(gpGlobals + 0xc) - *(float *)(this + 0x340c))))))) {
                *(CBaseEntity **)param_1 = this;
              }
            }
          }
          else if (*(float *)(RescueMinDeadTime._28_4_ + 0x2c) <=
                   *(float *)(gpGlobals + 0xc) - *(float *)(this + 0x340c)) goto LAB_0089074f;
        }
        else if (this != (CBaseEntity *)**(int **)(param_1 + 4)) {
          iVar3 = 0;
          do {
            iVar3 = iVar3 + 1;
            if (iVar3 == *(int *)(param_1 + 0x10)) goto LAB_00890720;
          } while (this != (CBaseEntity *)(*(int **)(param_1 + 4))[iVar3]);
          if (iVar3 < 0) goto LAB_00890720;
        }
      }
      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)