L L4D2node

TextToSoundLevel

0x005988e0 · 184 bytes · __cdecl

_Z16TextToSoundLevelPKc

Decompiled

undefined (1 param)

/* TextToSoundLevel(char const*) */

long TextToSoundLevel(char *param_1)

{
  int iVar1;
  long lVar2;
  long *plVar3;
  
  if (param_1 == (char *)0x0) {
    return 0x4b;
  }
  plVar3 = &g_pSoundLevels;
  do {
    iVar1 = V_strcasecmp(param_1,(char *)plVar3[1]);
    if (iVar1 == 0) {
      return *plVar3;
    }
    plVar3 = plVar3 + 2;
  } while (plVar3 != (long *)g_pPitchLookup);
  iVar1 = _V_strlen("SNDLVL_");
  iVar1 = V_strnicmp(param_1,"SNDLVL_",iVar1);
  if (iVar1 == 0) {
    iVar1 = _V_strlen("SNDLVL_");
    lVar2 = strtol(param_1 + iVar1,(char **)0x0,10);
    if (lVar2 - 1U < 0xb4) {
      return lVar2;
    }
  }
  DevMsg("CSoundEmitterSystem:  Unknown sound level %s\n",param_1);
  return 0x4b;
}

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)