L L4D2node

CBaseCombatCharacter::GetFogObscuredRatio

0x005f06e0 · 115 bytes · __thiscall

_ZNK20CBaseCombatCharacter19GetFogObscuredRatioEf

Decompiled

undefined (2 params)

/* CBaseCombatCharacter::GetFogObscuredRatio(float) const */

longdouble __thiscall
CBaseCombatCharacter::GetFogObscuredRatio(CBaseCombatCharacter *this,float param_1)

{
  float fVar1;
  fogparams_t local_60 [32];
  float local_40;
  float local_3c;
  float local_34;
  char local_14;
  
  fogparams_t::fogparams_t(local_60);
  (**(code **)(*(int *)this + 0x418))(this,local_60);
  fVar1 = 0.0;
  if ((local_14 != '\0') && (local_40 < param_1)) {
    fVar1 = 1.0;
    if (param_1 < local_3c) {
      fVar1 = (param_1 - local_40) / (local_3c - local_40);
      if (local_34 <= fVar1) {
        fVar1 = local_34;
      }
    }
  }
  return (longdouble)fVar1;
}

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)