L L4D2node

UTIL_IsFacingWithinTolerance

0x00b2edb0 · 221 bytes · __cdecl

_Z28UTIL_IsFacingWithinToleranceP11CBaseEntityRK6VectorfPf

Decompiled

undefined (4 params)

/* UTIL_IsFacingWithinTolerance(CBaseEntity*, Vector const&, float, float*) */

bool UTIL_IsFacingWithinTolerance(CBaseEntity *param_1,Vector *param_2,float param_3,float *param_4)

{
  bool bVar1;
  float fVar2;
  float local_34;
  float local_30;
  float local_2c;
  float local_28;
  float local_24;
  float local_20;
  
  if (param_4 != (float *)0x0) {
    *param_4 = 0.0;
  }
  bVar1 = false;
  if (param_1 != (CBaseEntity *)0x0) {
    (**(code **)(*(int *)param_1 + 0x24c))(param_1,&local_34,0,0);
    if (((byte)param_1[0x14d] & 8) != 0) {
      CBaseEntity::CalcAbsolutePosition(param_1);
    }
    local_28 = *(float *)param_2 - *(float *)(param_1 + 0x2e0);
    local_24 = *(float *)(param_2 + 4) - *(float *)(param_1 + 0x2e4);
    local_20 = *(float *)(param_2 + 8) - *(float *)(param_1 + 0x2e8);
    VectorNormalize((Vector *)&local_28);
    fVar2 = local_30 * local_24 + local_34 * local_28 + local_2c * local_20;
    if (param_4 != (float *)0x0) {
      *param_4 = fVar2;
    }
    bVar1 = param_3 <= fVar2;
  }
  return bVar1;
}

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)