L L4D2node

CModelSoundsCache::FindOrAddScriptSound

0x004698a0 · 114 bytes · __cdecl

_ZN17CModelSoundsCache20FindOrAddScriptSoundER10CUtlVectorIt10CUtlMemoryItiEEPKc

Decompiled

undefined (2 params)

/* CModelSoundsCache::FindOrAddScriptSound(CUtlVector<unsigned short, CUtlMemory<unsigned short,
   int> >&, char const*) */

void CModelSoundsCache::FindOrAddScriptSound(CUtlVector *param_1,char *param_2)

{
  int iVar1;
  int iVar2;
  ushort local_1e [7];
  
  iVar2 = (**(code **)(*soundemitterbase + 0x1c))(soundemitterbase,param_2);
  if (iVar2 != -1) {
    iVar1 = *(int *)(param_1 + 0xc);
    local_1e[0] = (ushort)iVar2;
    if (0 < iVar1) {
      if (local_1e[0] == **(ushort **)param_1) {
        return;
      }
      iVar2 = 0;
      do {
        iVar2 = iVar2 + 1;
        if (iVar2 == iVar1) goto LAB_004698ed;
      } while (local_1e[0] != (*(ushort **)param_1)[iVar2]);
      if (iVar2 != -1) {
        return;
      }
    }
LAB_004698ed:
    CUtlVector<unsigned_short,CUtlMemory<unsigned_short,int>>::InsertBefore
              ((CUtlVector<unsigned_short,CUtlMemory<unsigned_short,int>> *)param_1,iVar1,local_1e);
  }
  return;
}

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)