CSentence::EstimateBestWord
0x000dd590 · 105 bytes · __thiscall
_ZN9CSentence16EstimateBestWordEf
Decompiled
undefined (2 params)
/* CSentence::EstimateBestWord(float) */
float * __thiscall CSentence::EstimateBestWord(CSentence *this,float param_1)
{
float *pfVar1;
int iVar2;
float *pfVar3;
if (*(int *)(this + 0x10) < 1) {
pfVar3 = (float *)0x0;
}
else {
iVar2 = 0;
pfVar3 = (float *)0x0;
do {
pfVar1 = *(float **)(*(int *)(this + 4) + iVar2 * 4);
if (pfVar1 != (float *)0x0) {
if (*pfVar1 <= param_1) {
if (param_1 < pfVar1[1] || param_1 == pfVar1[1]) {
return pfVar1;
}
if (pfVar3 != (float *)0x0) {
return pfVar3;
}
}
else {
pfVar3 = pfVar1;
if (pfVar1[1] <= param_1 && param_1 != pfVar1[1]) {
return pfVar1;
}
}
}
iVar2 = iVar2 + 1;
} while (iVar2 != *(int *)(this + 0x10));
if (pfVar3 == (float *)0x0) {
return *(float **)(*(int *)(this + 4) + -4 + iVar2 * 4);
}
}
return pfVar3;
}
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.