L L4D2node

CBaseAnimating::GetLastVisibleCycle

0x005e3490 · 374 bytes · __thiscall

_ZN14CBaseAnimating19GetLastVisibleCycleEP10CStudioHdri

Decompiled

undefined (3 params)

/* CBaseAnimating::GetLastVisibleCycle(CStudioHdr*, int) */

longdouble __thiscall
CBaseAnimating::GetLastVisibleCycle(CBaseAnimating *this,CStudioHdr *param_1,int param_2)

{
  float fVar1;
  float fVar2;
  uint uVar3;
  int iVar4;
  undefined1 *puVar5;
  CStudioHdr *pCVar6;
  CStudioHdr *pCVar7;
  longdouble lVar8;
  float fVar9;
  float fVar10;
  
  if (param_1 == (CStudioHdr *)0x0) {
    puVar5 = &DAT_00d539c2;
    if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
      puVar5 = *(undefined1 **)(this + 0x7c);
    }
    DevWarning(2,"CBaseAnimating::LastVisibleCycle( %d ) NULL pstudiohdr on %s!\n",param_2,puVar5);
    return (longdouble)1.0;
  }
  uVar3 = GetSequenceFlags(param_1,param_2);
  fVar9 = 1.0;
  if ((uVar3 & 1) != 0) goto LAB_005e34c2;
  iVar4 = CStudioHdr::pSeqdesc(param_1,param_2);
  fVar1 = *(float *)(iVar4 + 0x6c);
  pCVar6 = *(CStudioHdr **)(this + 0x13e0);
  if (pCVar6 == (CStudioHdr *)0x0) {
    iVar4 = CBaseEntity::GetModel((CBaseEntity *)this);
    if (iVar4 == 0) {
      pCVar6 = *(CStudioHdr **)(this + 0x13e0);
    }
    else {
      LockStudioHdr(this);
      pCVar6 = *(CStudioHdr **)(this + 0x13e0);
    }
    pCVar7 = (CStudioHdr *)0x0;
    if (pCVar6 != (CStudioHdr *)0x0) goto LAB_005e34fc;
  }
  else {
LAB_005e34fc:
    pCVar7 = (CStudioHdr *)0x0;
    if (*(int *)pCVar6 != 0) {
      pCVar7 = pCVar6;
    }
  }
  lVar8 = (longdouble)SequenceDuration(this,pCVar7,param_2);
  if ((float)lVar8 <= 0.0) {
    fVar10 = 10.0;
  }
  else {
    fVar10 = 1.0 / (float)lVar8;
  }
  fVar9 = 1.0;
  fVar2 = *(float *)(this + 0x528);
  if (fVar2 < 0.0) {
    fVar9 = 1.0 - *(float *)(this + 0x468) * fVar1 * fVar10;
  }
  else if (fVar2 <= 1.0) {
    fVar9 = 1.0 - *(float *)(this + 0x468) * fVar1 * (1.0 - fVar2) * fVar10;
  }
LAB_005e34c2:
  return (longdouble)fVar9;
}

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)