L L4D2node

KeyValues::GetFloat

0x0024e100 · 220 bytes · __thiscall

_ZN9KeyValues8GetFloatEPKcf

Decompiled

undefined (3 params)

/* KeyValues::GetFloat(char const*, float) */

longdouble __thiscall KeyValues::GetFloat(KeyValues *this,char *param_1,float param_2)

{
  int iVar1;
  longdouble lVar2;
  double dVar3;
  float fVar4;
  
  iVar1 = FindKey(this,param_1,false);
  if (iVar1 != 0) {
    switch(*(undefined1 *)(iVar1 + 0x10)) {
    default:
      lVar2 = (longdouble)0;
      break;
    case 1:
      dVar3 = strtod(*(char **)(iVar1 + 4),(char **)0x0);
      lVar2 = (longdouble)(float)dVar3;
      break;
    case 2:
      return (longdouble)*(int *)(iVar1 + 0xc);
    case 3:
      return (longdouble)*(float *)(iVar1 + 0xc);
    case 5:
      fVar4 = wcstof(*(wchar_t **)(iVar1 + 8),(wchar_t **)0x0);
      return (longdouble)fVar4;
    case 7:
      lVar2 = (longdouble)**(longlong **)(iVar1 + 4);
      if (*(int *)((int)*(longlong **)(iVar1 + 4) + 4) < 0) {
        lVar2 = lVar2 + (longdouble)1.8446744e+19;
      }
      return lVar2;
    }
    return lVar2;
  }
  return (longdouble)param_2;
}

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)