L L4D2node

CStudioHdr::CActivityToSequenceMapping::NumSequencesForActivity

0x000e3ec0 · 188 bytes · __thiscall

_ZN10CStudioHdr26CActivityToSequenceMapping23NumSequencesForActivityEi

Decompiled

undefined (2 params)

/* CStudioHdr::CActivityToSequenceMapping::NumSequencesForActivity(int) */

undefined4 __thiscall
CStudioHdr::CActivityToSequenceMapping::NumSequencesForActivity
          (CActivityToSequenceMapping *this,int param_1)

{
  undefined4 *puVar1;
  uint uVar2;
  uint uVar3;
  uint uVar4;
  int *piVar5;
  uint local_20;
  
  if (*(int *)this == 0) {
    return 0;
  }
  uVar2 = HashInt(param_1);
  if (this[0x1e] == (CActivityToSequenceMapping)0x0) {
    local_20 = *(uint *)(this + 0x14);
    uVar2 = uVar2 % local_20;
  }
  else {
    uVar2 = uVar2 & *(uint *)(this + 0x20);
    local_20 = *(uint *)(this + 0x14);
  }
  puVar1 = (undefined4 *)(*(int *)(this + 8) + uVar2 * 0x14);
  uVar4 = puVar1[3];
  if ((int)uVar4 < 1) {
    if (uVar4 == 0) {
LAB_000e3f1f:
      uVar4 = 0xffff;
      uVar2 = 0xffff;
      goto LAB_000e3f2e;
    }
LAB_000e3f5f:
    uVar3 = 0;
  }
  else {
    piVar5 = (int *)*puVar1;
    if (param_1 == *piVar5) goto LAB_000e3f5f;
    uVar3 = 0;
    do {
      piVar5 = piVar5 + 4;
      uVar3 = uVar3 + 1;
      if (uVar3 == uVar4) goto LAB_000e3f1f;
    } while (param_1 != *piVar5);
  }
  uVar4 = uVar3 & 0xffff;
  uVar2 = (uVar2 << 0x10 | uVar3) >> 0x10;
LAB_000e3f2e:
  if (((int)uVar2 < (int)local_20) &&
     (piVar5 = (int *)(*(int *)(this + 8) + uVar2 * 0x14), (int)uVar4 < piVar5[3])) {
    return *(undefined4 *)(uVar4 * 0x10 + *piVar5 + 8);
  }
  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)