L L4D2node

VOX_Precache

0x000f3060 · 717 bytes · __cdecl

_Z12VOX_PrecacheP12IEngineSoundiPKc

Decompiled

undefined (3 params)

/* VOX_Precache(IEngineSound*, int, char const*) */

void VOX_Precache(IEngineSound *param_1,int param_2,char *param_3)

{
  undefined4 *puVar1;
  char *pcVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  voxword_t *pvVar6;
  int in_GS_OFFSET;
  int local_948;
  int local_944;
  int local_93c [37];
  voxword_t local_8a8 [1152];
  char local_428 [260];
  char local_324 [260];
  char local_220 [512];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  puVar1 = (undefined4 *)(g_Sentences + param_2 * 0xc);
  if ((*(char *)*puVar1 != 'V') || (((char *)*puVar1)[1] != '_')) {
    *(byte *)(puVar1 + 2) = *(byte *)(puVar1 + 2) | 0x80;
  }
  pvVar6 = local_8a8;
  for (iVar3 = 0x120; iVar3 != 0; iVar3 = iVar3 + -1) {
    *(undefined4 *)pvVar6 = 0;
    pvVar6 = pvVar6 + 4;
  }
  pcVar2 = (char *)*puVar1;
  iVar3 = _V_strlen(pcVar2);
  pcVar2 = (char *)VOX_GetDirectory(local_428,0x104,pcVar2 + iVar3 + 1);
  V_strncpy(local_220,pcVar2,0x200);
  if (param_3 != (char *)0x0) {
    V_strncpy(local_428,param_3,0x104);
  }
  VOX_ParseString(local_220);
  iVar4 = 0;
  iVar3 = rgpparseword;
  if (rgpparseword != 0) {
    do {
      local_93c[iVar4 + 5] = iVar3;
      iVar4 = iVar4 + 1;
      iVar3 = (&rgpparseword)[iVar4];
    } while ((&rgpparseword)[iVar4] != 0);
    local_948 = 0;
    local_944 = 0;
    do {
      pcVar2 = (char *)local_93c[local_944 + 5];
      if ((*pcVar2 == 'V') && (pcVar2[1] == '_')) {
        local_93c[0] = 0;
        local_93c[1] = 0;
        local_93c[2] = 0;
        local_93c[3] = 0;
        local_93c[4] = 0;
                    /* try { // try from 000f3210 to 000f327b has its CatchHandler @ 000f3338 */
        VOX_BuildVirtualNameList(pcVar2,(CUtlVector *)local_93c);
        iVar3 = local_93c[3];
        iVar5 = 0;
        if (0 < local_93c[3]) {
          do {
            V_snprintf(local_324,0x104,"%s%s.wav",local_428,iVar5 * 0x100 + local_93c[0]);
            (*(code *)**(undefined4 **)param_1)(param_1,local_324,0,0);
            iVar5 = iVar5 + 1;
          } while (iVar5 != iVar3);
        }
        local_93c[3] = 0;
        CUtlMemory<WordBuf,int>::Purge((CUtlMemory<WordBuf,int> *)local_93c);
        local_93c[4] = local_93c[0];
        CUtlMemory<WordBuf,int>::Purge((CUtlMemory<WordBuf,int> *)local_93c);
      }
      else {
        iVar3 = VOX_ParseWordParams(pcVar2,local_8a8 + local_948 * 0x24,(uint)(local_944 == 0));
        if (iVar3 != 0) {
          V_snprintf(local_324,0x104,"%s%s.wav",local_428,pcVar2);
          (*(code *)**(undefined4 **)param_1)(param_1,local_324,0,0);
          local_948 = local_948 + 1;
        }
      }
      local_944 = local_944 + 1;
    } while (local_944 != iVar4);
  }
  if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
    __stack_chk_fail();
  }
  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)