L L4D2node

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 into addons/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.



        

        

          

Type inference is best-effort from the C signature - sanity-check the DHooks types before shipping.

Return-type handling cheatsheet (DHookReturn)