L L4D2node

CBaseCombatCharacter::FInViewCone

0x005ef880 · 265 bytes · __thiscall

_ZN20CBaseCombatCharacter11FInViewConeERK6Vector

Decompiled

undefined (2 params)

/* CBaseCombatCharacter::FInViewCone(Vector const&) */

bool __thiscall CBaseCombatCharacter::FInViewCone(CBaseCombatCharacter *this,Vector *param_1)

{
  float fVar1;
  bool bVar2;
  float fVar3;
  float fVar4;
  float local_24;
  float local_20;
  float local_18;
  float local_14;
  float local_10;
  
  (**(code **)(*(int *)this + 0x234))(&local_24,this);
  fVar1 = *(float *)(this + 0x17e8);
  fVar4 = *(float *)(param_1 + 8);
  (**(code **)(*(int *)this + 0x3f8))(&local_18,this);
  local_24 = *(float *)param_1 - local_24;
  local_20 = *(float *)(param_1 + 4) - local_20;
  fVar4 = *(float *)(param_1 + 8) - fVar4;
  fVar3 = local_14 * local_20 + local_18 * local_24 + local_10 * fVar4;
  if (fVar1 <= 0.0) {
    bVar2 = true;
    if (fVar3 <= 0.0) {
      bVar2 = fVar3 * fVar3 <=
              fVar1 * fVar1 * (local_20 * local_20 + local_24 * local_24 + fVar4 * fVar4);
    }
  }
  else {
    if (fVar3 < 0.0) {
      return false;
    }
    bVar2 = fVar1 * fVar1 * (local_20 * local_20 + local_24 * local_24 + fVar4 * fVar4) <=
            fVar3 * fVar3;
  }
  return bVar2;
}

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)