CRagdollMagnet::DistToPoint
0x00650010 · 788 bytes · __thiscall
_ZN14CRagdollMagnet11DistToPointERK6Vector
Decompiled
undefined (2 params)
/* CRagdollMagnet::DistToPoint(Vector const&) */
longdouble __thiscall CRagdollMagnet::DistToPoint(CRagdollMagnet *this,Vector *param_1)
{
Vector *pVVar1;
char cVar2;
longdouble lVar3;
longdouble lVar4;
float fVar5;
float local_7c;
float local_78;
float local_74;
Vector local_70 [12];
Vector local_64 [12];
CPlane local_58 [20];
CPlane local_44 [20];
float local_30;
float local_2c;
float local_28;
if (((byte)this[0x148] & 2) == 0) {
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
return (longdouble)
SQRT((*(float *)(this + 0x2e4) - *(float *)(param_1 + 4)) *
(*(float *)(this + 0x2e4) - *(float *)(param_1 + 4)) +
(*(float *)(this + 0x2e0) - *(float *)param_1) *
(*(float *)(this + 0x2e0) - *(float *)param_1) +
(*(float *)(this + 0x2e8) - *(float *)(param_1 + 8)) *
(*(float *)(this + 0x2e8) - *(float *)(param_1 + 8)));
}
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
local_78 = *(float *)(this + 0x450) - *(float *)(this + 0x2e4);
local_74 = *(float *)(this + 0x454) - *(float *)(this + 0x2e8);
local_7c = *(float *)(this + 0x44c) - *(float *)(this + 0x2e0);
VectorNormalize((Vector *)&local_7c);
CPlane::CPlane(local_58);
CPlane::CPlane(local_44);
local_28 = -local_74;
local_2c = -local_78;
local_30 = -local_7c;
CPlane::InitializePlane(local_44,(Vector *)&local_30,(Vector *)(this + 0x44c));
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
pVVar1 = (Vector *)(this + 0x2e0);
CPlane::InitializePlane(local_58,(Vector *)&local_7c,pVVar1);
cVar2 = CPlane::PointInFront(local_58,param_1);
if (cVar2 != '\0') {
cVar2 = CPlane::PointInFront(local_44,param_1);
if (cVar2 != '\0') {
CPlane::CPlane((CPlane *)&local_30);
VectorVectors((Vector *)&local_7c,local_64,local_70);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
CPlane::InitializePlane((CPlane *)&local_30,local_64,pVVar1);
lVar3 = (longdouble)CPlane::PointDist((CPlane *)&local_30,param_1);
if (((byte)this[0x14d] & 8) != 0) {
CBaseEntity::CalcAbsolutePosition((CBaseEntity *)this);
}
CPlane::InitializePlane((CPlane *)&local_30,local_70,pVVar1);
lVar4 = (longdouble)CPlane::PointDist((CPlane *)&local_30,param_1);
fVar5 = ABS((float)lVar4);
if (ABS((float)lVar4) <= ABS((float)lVar3)) {
fVar5 = ABS((float)lVar3);
}
return (longdouble)fVar5;
}
}
return (longdouble)3.4028235e+38;
}
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.