CPointAngleSensor::IsFacingWithinTolerance
0x007d7ef0 · 330 bytes · __thiscall
_ZN17CPointAngleSensor23IsFacingWithinToleranceEP11CBaseEntityS1_fPf
Decompiled
undefined (5 params)
/* CPointAngleSensor::IsFacingWithinTolerance(CBaseEntity*, CBaseEntity*, float, float*) */
bool __thiscall
CPointAngleSensor::IsFacingWithinTolerance
(CPointAngleSensor *this,CBaseEntity *param_1,CBaseEntity *param_2,float param_3,
float *param_4)
{
float fVar1;
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;
}
if ((param_1 != (CBaseEntity *)0x0) && (param_2 != (CBaseEntity *)0x0)) {
(**(code **)(*(int *)param_1 + 0x24c))(param_1,&local_34,0,0);
if (((byte)this[0x148] & 1) == 0) {
if (((byte)param_1[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_1);
}
if (((byte)param_2[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition(param_2);
}
local_24 = *(float *)(param_2 + 0x2e4) - *(float *)(param_1 + 0x2e4);
local_20 = *(float *)(param_2 + 0x2e8) - *(float *)(param_1 + 0x2e8);
local_28 = *(float *)(param_2 + 0x2e0) - *(float *)(param_1 + 0x2e0);
VectorNormalize((Vector *)&local_28);
}
else {
(**(code **)(*(int *)param_2 + 0x24c))(param_2,&local_28,0,0);
}
fVar1 = local_30 * local_24 + local_34 * local_28 + local_2c * local_20;
if (param_4 != (float *)0x0) {
*param_4 = fVar1;
}
return *(float *)(this + 0x454) <= fVar1;
}
return false;
}
SourceMod gamedata
paste intoaddons/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.
Signatures + Functions block. The plugin uses
DHookCreateFromConf - DHooks reads return type, this-type,
calling convention, and argument types straight from the gamedata. Less
boilerplate in the plugin, types travel with the gamedata.
Gamedata KeyValues
DHooks plugin example
Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.