L L4D2node

HasAnimationEventOfType

0x003fb560 · 127 bytes · __cdecl

_Z23HasAnimationEventOfTypeP10CStudioHdrii

Decompiled

undefined (3 params)

/* HasAnimationEventOfType(CStudioHdr*, int, int) */

undefined4 HasAnimationEventOfType(CStudioHdr *param_1,int param_2,int param_3)

{
  mstudioseqdesc_t *pmVar1;
  int iVar2;
  mstudioseqdesc_t *pmVar3;
  mstudioseqdesc_t *pmVar4;
  
  if (((param_1 != (CStudioHdr *)0x0) && (iVar2 = CStudioHdr::GetNumSeq(param_1), param_2 < iVar2))
     && (pmVar3 = (mstudioseqdesc_t *)CStudioHdr::pSeqdesc(param_1,param_2),
        pmVar3 != (mstudioseqdesc_t *)0x0)) {
    if (((byte)pmVar3[0xd] & 0x20) == 0) {
      SetEventIndexForSequence(pmVar3);
    }
    pmVar4 = pmVar3 + *(int *)(pmVar3 + 0x1c);
    if ((pmVar4 != (mstudioseqdesc_t *)0x0) && (0 < *(int *)(pmVar3 + 0x18))) {
      if (*(int *)(pmVar4 + 4) != param_3) {
        iVar2 = 0;
        do {
          iVar2 = iVar2 + 1;
          if (iVar2 == *(int *)(pmVar3 + 0x18)) {
            return 0;
          }
          pmVar1 = pmVar4 + 0x54;
          pmVar4 = pmVar4 + 0x50;
        } while (*(int *)pmVar1 != param_3);
      }
      return 1;
    }
  }
  return 0;
}

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)