L L4D2node

GetAnimationEvent

0x003fb5f0 · 288 bytes · __cdecl

_Z17GetAnimationEventP10CStudioHdriP11animevent_tffi

Decompiled

undefined (6 params)

/* GetAnimationEvent(CStudioHdr*, int, animevent_t*, float, float, int) */

int GetAnimationEvent(CStudioHdr *param_1,int param_2,animevent_t *param_3,float param_4,
                     float param_5,int param_6)

{
  float fVar1;
  int iVar2;
  int iVar3;
  mstudioseqdesc_t *pmVar4;
  mstudioseqdesc_t *pmVar5;
  
  if (((param_1 != (CStudioHdr *)0x0) && (iVar3 = CStudioHdr::GetNumSeq(param_1), param_2 < iVar3))
     && (param_3 != (animevent_t *)0x0)) {
    pmVar4 = (mstudioseqdesc_t *)CStudioHdr::pSeqdesc(param_1,param_2);
    iVar3 = *(int *)(pmVar4 + 0x18);
    if ((iVar3 != 0) && (param_6 < iVar3)) {
      if (((byte)pmVar4[0xd] & 0x20) == 0) {
        SetEventIndexForSequence(pmVar4);
        iVar2 = *(int *)(pmVar4 + 0x1c);
        iVar3 = *(int *)(pmVar4 + 0x18);
        if (iVar3 <= param_6) {
          return 0;
        }
      }
      else {
        iVar2 = *(int *)(pmVar4 + 0x1c);
      }
      pmVar5 = pmVar4 + param_6 * 0x50 + iVar2;
      do {
        if (((uint)*(float *)(pmVar5 + 8) & 0x400) == 0) {
          if ((int)*(float *)(pmVar5 + 4) < 5000) goto LAB_003fb665;
        }
        else if (((uint)*(float *)(pmVar5 + 8) & 1) != 0) {
LAB_003fb665:
          fVar1 = *(float *)pmVar5;
          if (((param_4 <= fVar1) && (fVar1 < param_5)) ||
             (((((byte)pmVar4[0xc] & 1) != 0 && (param_5 < param_4)) &&
              ((param_4 <= fVar1 || (fVar1 < param_5)))))) {
            *(undefined4 *)(param_3 + 0x14) = 0;
            iVar3 = gpGlobals;
            *(float *)(param_3 + 8) = *(float *)pmVar5;
            *(undefined4 *)(param_3 + 0xc) = *(undefined4 *)(iVar3 + 0xc);
            *(float *)param_3 = *(float *)(pmVar5 + 4);
            *(mstudioseqdesc_t **)(param_3 + 4) = pmVar5 + 0xc;
            *(float *)(param_3 + 0x10) = *(float *)(pmVar5 + 8);
            return param_6 + 1;
          }
        }
        param_6 = param_6 + 1;
        pmVar5 = pmVar5 + 0x50;
      } while (param_6 < iVar3);
    }
  }
  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)