L L4D2node

CBaseAnimatingOverlay::GetLayerDuration

0x005ec5d0 · 376 bytes · __thiscall

_ZN21CBaseAnimatingOverlay16GetLayerDurationEi

Decompiled

undefined (2 params)

/* CBaseAnimatingOverlay::GetLayerDuration(int) */

longdouble __thiscall
CBaseAnimatingOverlay::GetLayerDuration(CBaseAnimatingOverlay *this,int param_1)

{
  int iVar1;
  int iVar2;
  CStudioHdr *pCVar3;
  byte *pbVar4;
  CStudioHdr *pCVar5;
  longdouble lVar6;
  float fVar7;
  
  fVar7 = 0.0;
  if ((param_1 < 0) || (fVar7 = 0.0, *(int *)(this + 0x1400) <= param_1)) goto LAB_005ec63d;
  pbVar4 = (byte *)(*(int *)(this + 0x13f4) + param_1 * 0x4c);
  if ((*pbVar4 & 1) == 0) goto LAB_005ec63d;
  if (*(float *)(pbVar4 + 0x18) != 0.0) {
    fVar7 = *(float *)(pbVar4 + 0xc);
    iVar1 = *(int *)(pbVar4 + 8);
    pCVar3 = *(CStudioHdr **)(this + 0x13e0);
    if (pCVar3 == (CStudioHdr *)0x0) {
      iVar2 = CBaseEntity::GetModel((CBaseEntity *)this);
      if (iVar2 == 0) {
        pCVar3 = *(CStudioHdr **)(this + 0x13e0);
      }
      else {
        CBaseAnimating::LockStudioHdr((CBaseAnimating *)this);
        pCVar3 = *(CStudioHdr **)(this + 0x13e0);
      }
      pCVar5 = (CStudioHdr *)0x0;
      if (pCVar3 == (CStudioHdr *)0x0) goto LAB_005ec67e;
    }
    pCVar5 = (CStudioHdr *)0x0;
    if (*(int *)pCVar3 != 0) {
      pCVar5 = pCVar3;
    }
LAB_005ec67e:
    lVar6 = (longdouble)CBaseAnimating::SequenceDuration((CBaseAnimating *)this,pCVar5,iVar1);
    return (longdouble)
           (((float)lVar6 * (1.0 - fVar7)) /
           *(float *)(*(int *)(this + 0x13f4) + 0x18 + param_1 * 0x4c));
  }
  pCVar3 = *(CStudioHdr **)(this + 0x13e0);
  iVar1 = *(int *)(pbVar4 + 8);
  if (pCVar3 == (CStudioHdr *)0x0) {
    iVar2 = CBaseEntity::GetModel((CBaseEntity *)this);
    if (iVar2 == 0) {
      pCVar3 = *(CStudioHdr **)(this + 0x13e0);
    }
    else {
      CBaseAnimating::LockStudioHdr((CBaseAnimating *)this);
      pCVar3 = *(CStudioHdr **)(this + 0x13e0);
    }
    pCVar5 = (CStudioHdr *)0x0;
    if (pCVar3 != (CStudioHdr *)0x0) goto LAB_005ec61c;
  }
  else {
LAB_005ec61c:
    pCVar5 = (CStudioHdr *)0x0;
    if (*(int *)pCVar3 != 0) {
      pCVar5 = pCVar3;
    }
  }
  lVar6 = (longdouble)CBaseAnimating::SequenceDuration((CBaseAnimating *)this,pCVar5,iVar1);
  fVar7 = (float)lVar6;
LAB_005ec63d:
  return (longdouble)fVar7;
}

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)