L L4D2node

SelectHeaviestSequence

0x003fbe60 · 127 bytes · __cdecl

_Z22SelectHeaviestSequenceP10CStudioHdri

Decompiled

undefined (2 params)

/* SelectHeaviestSequence(CStudioHdr*, int) */

int SelectHeaviestSequence(CStudioHdr *param_1,int param_2)

{
  int iVar1;
  int iVar2;
  int local_34;
  int local_30;
  uint local_20 [4];
  
  local_34 = 0;
  if (param_1 != (CStudioHdr *)0x0) {
    VerifySequenceIndex(param_1);
    local_20[0] = 0;
    local_34 = -1;
    local_30 = 0;
    for (iVar2 = 0; iVar1 = CStudioHdr::GetNumSeq(param_1), iVar2 < iVar1; iVar2 = iVar2 + 1) {
      iVar1 = GetSequenceActivity(param_1,iVar2,(int *)local_20);
      if ((iVar1 == param_2) &&
         (iVar1 = (local_20[0] ^ (int)local_20[0] >> 0x1f) - ((int)local_20[0] >> 0x1f),
         local_30 < iVar1)) {
        local_34 = iVar2;
        local_30 = iVar1;
      }
    }
  }
  return local_34;
}

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)