AttenuateCaption
0x00811f30 · 136 bytes · __cdecl
_Z16AttenuateCaptionPKcRK6VectorR10CUtlVectorIS1_10CUtlMemoryIS1_iEE
Decompiled
undefined (3 params)
/* AttenuateCaption(char const*, Vector const&, CUtlVector<Vector, CUtlMemory<Vector, int> >&) */
undefined4 AttenuateCaption(char *param_1,Vector *param_2,CUtlVector *param_3)
{
float fVar1;
float *pfVar2;
int iVar3;
fVar1 = *(float *)(scene_maxcaptionradius._28_4_ + 0x2c);
if ((0.0 < fVar1) && (0 < *(int *)(param_3 + 0xc))) {
pfVar2 = *(float **)param_3;
iVar3 = 0;
while (fVar1 * fVar1 <
(pfVar2[1] - *(float *)(param_2 + 4)) * (pfVar2[1] - *(float *)(param_2 + 4)) +
(*pfVar2 - *(float *)param_2) * (*pfVar2 - *(float *)param_2) +
(pfVar2[2] - *(float *)(param_2 + 8)) * (pfVar2[2] - *(float *)(param_2 + 8))) {
iVar3 = iVar3 + 1;
pfVar2 = pfVar2 + 3;
if (iVar3 == *(int *)(param_3 + 0xc)) {
return 1;
}
}
}
return 0;
}
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.