L L4D2node

GetWorldFogParams

0x006a9530 · 956 bytes · __cdecl

_Z17GetWorldFogParamsP20CBaseCombatCharacterR11fogparams_t

Decompiled

undefined (2 params)

/* GetWorldFogParams(CBaseCombatCharacter*, fogparams_t&) */

undefined4 GetWorldFogParams(CBaseCombatCharacter *param_1,fogparams_t *param_2)

{
  char cVar1;
  int iVar2;
  fogparams_t *this;
  undefined4 uVar3;
  undefined *puVar4;
  
  iVar2 = (**(code **)(*(int *)param_1 + 0x52c))(param_1);
  if (((iVar2 != 0) && (iVar2 = (**(code **)(*(int *)param_1 + 0x52c))(param_1), iVar2 != 0)) &&
     (cVar1 = TerrorNavMesh::GetFogParams
                        (TheNavMesh,*(fogparams_t **)(iVar2 + 0x160),(bool *)param_2), cVar1 != '\0'
     )) {
    return 0;
  }
  iVar2 = CBaseCombatCharacter::GetFogTrigger(param_1);
  if (((iVar2 == 0) || (iVar2 = CBaseCombatCharacter::GetFogTrigger(param_1), iVar2 == 0)) ||
     (iVar2 = __dynamic_cast(iVar2,&CBaseEntity::typeinfo,&CFogTrigger::typeinfo,0), iVar2 == 0)) {
    if (((s_FogSystem._24_4_ != -1) &&
        (puVar4 = g_pEntityList + (s_FogSystem._24_4_ & 0xfff) * 0x10,
        puVar4 != (undefined *)0xfffffffc)) &&
       ((*(uint *)(puVar4 + 8) == (uint)s_FogSystem._24_4_ >> 0xc && (*(int *)(puVar4 + 4) != 0))))
    {
      this = (fogparams_t *)(*(int *)(puVar4 + 4) + 0x440);
      goto LAB_006a95db;
    }
  }
  else {
    this = (fogparams_t *)(iVar2 + 0x56c);
    if (this != (fogparams_t *)0x0) {
LAB_006a95db:
      uVar3 = fogparams_t::operator!=(this,param_2);
      if ((char)uVar3 == '\0') {
        return 0;
      }
      if (((*(float *)(this + 4) != *(float *)(param_2 + 4)) ||
          (*(float *)(this + 8) != *(float *)(param_2 + 8))) ||
         (*(float *)(this + 0xc) != *(float *)(param_2 + 0xc))) {
        (**(code **)(*(int *)param_2 + 4))(param_2,param_2 + 4);
        *(undefined4 *)(param_2 + 4) = *(undefined4 *)(this + 4);
        *(undefined4 *)(param_2 + 8) = *(undefined4 *)(this + 8);
        *(undefined4 *)(param_2 + 0xc) = *(undefined4 *)(this + 0xc);
      }
      if (((param_2[0x10] != this[0x10]) || (param_2[0x11] != this[0x11])) ||
         ((param_2[0x12] != this[0x12] || (param_2[0x13] != this[0x13])))) {
        (**(code **)(*(int *)param_2 + 4))(param_2,param_2 + 0x10);
        *(undefined4 *)(param_2 + 0x10) = *(undefined4 *)(this + 0x10);
      }
      if (((param_2[0x14] != this[0x14]) || (param_2[0x15] != this[0x15])) ||
         ((param_2[0x16] != this[0x16] || (param_2[0x17] != this[0x17])))) {
        (**(code **)(*(int *)param_2 + 4))(param_2,param_2 + 0x14);
        *(undefined4 *)(param_2 + 0x14) = *(undefined4 *)(this + 0x14);
      }
      if ((((param_2[0x18] != this[0x18]) || (param_2[0x19] != this[0x19])) ||
          (param_2[0x1a] != this[0x1a])) || (param_2[0x1b] != this[0x1b])) {
        (**(code **)(*(int *)param_2 + 4))(param_2,param_2 + 0x18);
        *(undefined4 *)(param_2 + 0x18) = *(undefined4 *)(this + 0x18);
      }
      if (((param_2[0x1c] != this[0x1c]) || (param_2[0x1d] != this[0x1d])) ||
         ((param_2[0x1e] != this[0x1e] || (param_2[0x1f] != this[0x1f])))) {
        (**(code **)(*(int *)param_2 + 4))(param_2,param_2 + 0x1c);
        *(undefined4 *)(param_2 + 0x1c) = *(undefined4 *)(this + 0x1c);
      }
      *(undefined4 *)(param_2 + 0x20) = *(undefined4 *)(this + 0x20);
      *(undefined4 *)(param_2 + 0x24) = *(undefined4 *)(this + 0x24);
      *(undefined4 *)(param_2 + 0x28) = *(undefined4 *)(this + 0x28);
      *(undefined4 *)(param_2 + 0x2c) = *(undefined4 *)(this + 0x2c);
      *(undefined4 *)(param_2 + 0x30) = *(undefined4 *)(this + 0x30);
      *(undefined4 *)(param_2 + 0x34) = *(undefined4 *)(this + 0x34);
      *(undefined4 *)(param_2 + 0x38) = *(undefined4 *)(this + 0x38);
      *(undefined4 *)(param_2 + 0x3c) = *(undefined4 *)(this + 0x3c);
      *(undefined4 *)(param_2 + 0x40) = *(undefined4 *)(this + 0x40);
      *(undefined4 *)(param_2 + 0x44) = *(undefined4 *)(this + 0x44);
      *(undefined4 *)(param_2 + 0x48) = *(undefined4 *)(this + 0x48);
      param_2[0x4c] = this[0x4c];
      param_2[0x4d] = this[0x4d];
      *(undefined4 *)(param_2 + 0x50) = *(undefined4 *)(this + 0x50);
      return uVar3;
    }
  }
  if (*(float *)(param_2 + 0x28) == -1.0) {
    if (param_2[0x4c] == (fogparams_t)0x0) {
      return 0;
    }
  }
  else {
    (**(code **)(*(int *)param_2 + 4))(param_2,param_2 + 0x28);
    *(undefined4 *)(param_2 + 0x28) = 0xbf800000;
    if (param_2[0x4c] == (fogparams_t)0x0) {
      return 1;
    }
  }
  (**(code **)(*(int *)param_2 + 4))(param_2,param_2 + 0x4c);
  param_2[0x4c] = (fogparams_t)0x0;
  return 1;
}

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)