L L4D2node

CModelSoundsCache::BuildAnimationEventSoundList

0x00469920 · 639 bytes · __cdecl

_ZN17CModelSoundsCache28BuildAnimationEventSoundListEP10CStudioHdrR10CUtlVectorIt10CUtlMemoryItiEE

Decompiled

undefined (2 params)

/* CModelSoundsCache::BuildAnimationEventSoundList(CStudioHdr*, CUtlVector<unsigned short,
   CUtlMemory<unsigned short, int> >&) */

void CModelSoundsCache::BuildAnimationEventSoundList(CStudioHdr *param_1,CUtlVector *param_2)

{
  int iVar1;
  bool bVar2;
  int iVar3;
  int iVar4;
  int iVar5;
  char *pcVar6;
  int in_GS_OFFSET;
  int local_134;
  char local_120 [256];
  int local_20;
  
  local_20 = *(int *)(in_GS_OFFSET + 0x14);
  VerifySequenceIndex(param_1);
  local_134 = 0;
  do {
    iVar3 = CStudioHdr::GetNumSeq(param_1);
    if (iVar3 <= local_134) {
      if (local_20 != *(int *)(in_GS_OFFSET + 0x14)) {
                    /* WARNING: Subroutine does not return */
        __stack_chk_fail();
      }
      return;
    }
    iVar3 = 1;
    iVar4 = CStudioHdr::pSeqdesc(param_1,local_134);
    if (0 < *(int *)(iVar4 + 0x18)) {
      do {
        iVar5 = iVar3 * 0x50 + -0x50 + *(int *)(iVar4 + 0x1c) + iVar4;
        iVar1 = *(int *)(iVar5 + 4);
        if (iVar1 == 0x3f0) {
LAB_004699d7:
          FindOrAddScriptSound(param_2,(char *)(iVar5 + 0xc));
        }
        else if (iVar1 < 0x3f1) {
          if (iVar1 != 0xf) {
            if (iVar1 != 0x3ec) {
LAB_00469b78:
              if (((*(byte *)(iVar5 + 9) & 4) == 0) || (iVar1 != 0x10)) goto LAB_004699ee;
            }
            goto LAB_004699d7;
          }
          if ((*(byte *)(iVar5 + 8) & 0x10) != 0) {
            if (*(char *)(iVar5 + 0xc) != '\0') goto LAB_004699d7;
            Warning("-- Error --:  empty soundname, .qc error on AE_CL_PLAYSOUND in model %s, sequence %s, animevent # %i\n"
                    ,*(int *)param_1 + 0xc,*(int *)(iVar4 + 4) + iVar4,iVar3,*(int *)param_1);
          }
        }
        else {
          if (iVar1 == 0x138c) goto LAB_004699d7;
          if ((iVar1 < 0x138c) || (1 < iVar1 - 0x1774U)) goto LAB_00469b78;
          pcVar6 = (char *)(iVar5 + 0xc);
          if (*(char *)(iVar5 + 0xc) == '\0') {
            pcVar6 = "NPC_CombineS";
          }
          V_snprintf(local_120,0x100,"%s.RunFootstepLeft",pcVar6);
          FindOrAddScriptSound(param_2,local_120);
          V_snprintf(local_120,0x100,"%s.RunFootstepRight",pcVar6);
          FindOrAddScriptSound(param_2,local_120);
          V_snprintf(local_120,0x100,"%s.FootstepLeft",pcVar6);
          FindOrAddScriptSound(param_2,local_120);
          V_snprintf(local_120,0x100,"%s.FootstepRight",pcVar6);
          FindOrAddScriptSound(param_2,local_120);
        }
LAB_004699ee:
        bVar2 = iVar3 < *(int *)(iVar4 + 0x18);
        iVar3 = iVar3 + 1;
      } while (bVar2);
    }
    local_134 = local_134 + 1;
  } while( true );
}

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)