L L4D2node

CDirector::IsLocationFoggedToSurvivors

0x0087aa90 · 341 bytes · __thiscall

_ZNK9CDirector27IsLocationFoggedToSurvivorsERK6Vector

Decompiled

undefined (2 params)

/* CDirector::IsLocationFoggedToSurvivors(Vector const&) const */

undefined4 __thiscall CDirector::IsLocationFoggedToSurvivors(CDirector *this,Vector *param_1)

{
  char cVar1;
  int iVar2;
  undefined4 uVar3;
  int iVar4;
  CBaseEntity *this_00;
  float fVar5;
  fogparams_t local_60 [40];
  float local_38;
  
  iVar2 = GetScriptValue(this,"ZombieSpawnInFog",
                         (uint)(*(int *)(DirectorPrivate_DirectorUseFogSpawning._28_4_ + 0x30) != 0)
                        );
  uVar3 = 0;
  if (iVar2 != 0) {
    iVar2 = 1;
    if (0 < *(int *)(gpGlobals + 0x14)) {
      do {
        while ((this_00 = (CBaseEntity *)UTIL_PlayerByIndex(iVar2), this_00 == (CBaseEntity *)0x0 ||
               (*(int *)(this_00 + 0x30) == 0))) {
LAB_0087ab10:
          iVar2 = iVar2 + 1;
          if (*(int *)(gpGlobals + 0x14) < iVar2) goto LAB_0087ab4c;
        }
        if (*(int *)(this_00 + 0x30) - *(int *)(gpGlobals + 0x58) >> 4 != 0) {
          cVar1 = (**(code **)(*(int *)this_00 + 0x16c))(this_00);
          if ((cVar1 != '\0') && (*(int *)(this_00 + 0x1f6c) != 2)) {
            iVar4 = CBaseEntity::GetTeamNumber(this_00);
            cVar1 = IsASurvivorTeam(iVar4);
            if (cVar1 != '\0') {
              fogparams_t::fogparams_t(local_60);
              (**(code **)(*(int *)this_00 + 0x418))(this_00,local_60);
              fVar5 = local_38 * local_38;
              if (((byte)this_00[0x14d] & 8) != 0) {
                CBaseEntity::CalcAbsolutePosition(this_00);
              }
              if ((*(float *)(this_00 + 0x2e0) - *(float *)param_1) *
                  (*(float *)(this_00 + 0x2e0) - *(float *)param_1) +
                  (*(float *)(this_00 + 0x2e4) - *(float *)(param_1 + 4)) *
                  (*(float *)(this_00 + 0x2e4) - *(float *)(param_1 + 4)) +
                  (*(float *)(this_00 + 0x2e8) - *(float *)(param_1 + 8)) *
                  (*(float *)(this_00 + 0x2e8) - *(float *)(param_1 + 8)) < fVar5) {
                return 0;
              }
            }
          }
          goto LAB_0087ab10;
        }
        iVar2 = iVar2 + 1;
      } while (iVar2 <= *(int *)(gpGlobals + 0x14));
    }
LAB_0087ab4c:
    uVar3 = 1;
  }
  return uVar3;
}

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)