IntersectRayWithSphere
0x000c5750 · 133 bytes · __cdecl
_Z22IntersectRayWithSphereRK6VectorS1_S1_fPfS2_
Decompiled
undefined (6 params)
/* IntersectRayWithSphere(Vector const&, Vector const&, Vector const&, float, float*, float*) */
undefined4
IntersectRayWithSphere
(Vector *param_1,Vector *param_2,Vector *param_3,float param_4,float *param_5,
float *param_6)
{
undefined4 uVar1;
float fVar2;
uVar1 = IntersectInfiniteRayWithSphere(param_1,param_2,param_3,param_4,param_5,param_6);
if ((char)uVar1 != '\0') {
if ((1.0 < *param_5) || (fVar2 = *param_6, fVar2 < 0.0)) {
uVar1 = 0;
}
else {
if (*param_5 < 0.0) {
*param_5 = 0.0;
fVar2 = *param_6;
}
if (1.0 < fVar2) {
*param_6 = 1.0;
return uVar1;
}
}
}
return uVar1;
}
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.