L L4D2node

CBaseAnimating::StudioFrameAdvance

0x005e7870 · 602 bytes · __thiscall

_ZN14CBaseAnimating18StudioFrameAdvanceEv

Decompiled

undefined (1 param)

/* CBaseAnimating::StudioFrameAdvance() */

void __thiscall CBaseAnimating::StudioFrameAdvance(CBaseAnimating *this)

{
  float fVar1;
  CBaseEdict *this_00;
  char cVar2;
  undefined4 uVar3;
  int iVar4;
  undefined1 *puVar5;
  CStudioHdr *this_01;
  longdouble lVar6;
  float fVar7;
  float fVar8;
  float fVar9;
  
  this_01 = *(CStudioHdr **)(this + 0x13e0);
  if (this_01 == (CStudioHdr *)0x0) {
    iVar4 = CBaseEntity::GetModel((CBaseEntity *)this);
    if (iVar4 == 0) {
      this_01 = *(CStudioHdr **)(this + 0x13e0);
    }
    else {
      LockStudioHdr(this);
      this_01 = *(CStudioHdr **)(this + 0x13e0);
    }
    if (this_01 == (CStudioHdr *)0x0) {
      return;
    }
  }
  if ((*(int *)this_01 != 0) && (cVar2 = CStudioHdr::SequencesAvailable(this_01), cVar2 != '\0')) {
    UpdateModelScale(this);
    fVar8 = *(float *)(this + 0x90);
    if (*(float *)(this + 0x8c) == 0.0) {
      *(float *)(this + 0x8c) = fVar8;
    }
    iVar4 = gpGlobals;
    fVar7 = *(float *)(gpGlobals + 0xc) - fVar8;
    if (fVar7 <= 0.0) {
      fVar7 = 0.0;
    }
    if (0.2 <= fVar7) {
      fVar7 = 0.2;
    }
    if (0.001 < fVar7) {
      *(float *)(this + 0x8c) = fVar8;
      fVar9 = *(float *)(iVar4 + 0xc);
      if (fVar9 != fVar8) {
        if (this[0x6c] == (CBaseAnimating)0x0) {
          this_00 = *(CBaseEdict **)(this + 0x30);
          if (this_00 != (CBaseEdict *)0x0) {
            *(uint *)this_00 = *(uint *)this_00 | 0x101;
            iVar4 = CBaseEdict::GetChangeAccessor(this_00);
            *(undefined2 *)(iVar4 + 2) = 0;
          }
        }
        else {
          this[0x70] = (CBaseAnimating)((byte)this[0x70] | 1);
        }
        *(float *)(this + 0x90) = fVar9;
      }
      fVar8 = 0.0;
      lVar6 = (longdouble)SequenceDuration(this,this_01,*(int *)(this + 0x494));
      fVar9 = 10.0;
      if (0.0 < (float)lVar6) {
        fVar9 = 1.0 / (float)lVar6;
      }
      fVar1 = *(float *)(this + 0x528);
      if (fVar1 < 0.0) {
        fVar8 = fVar7 * *(float *)(this + 0x468) * fVar9;
      }
      else if (fVar1 <= 1.0) {
        fVar8 = (1.0 - fVar1) * *(float *)(this + 0x468) * fVar7 * fVar9;
      }
      StudioFrameAdvanceInternal(this,this_01,fVar8);
      if ((*(int *)(ai_sequence_debug._28_4_ + 0x30) != 0) && (((byte)this[0x111] & 0x10) != 0)) {
        fVar8 = *(float *)(this + 0x490);
        uVar3 = GetSequenceName(this,*(int *)(this + 0x494));
        puVar5 = &DAT_00d539c2;
        if (*(undefined1 **)(this + 0x7c) != (undefined1 *)0x0) {
          puVar5 = *(undefined1 **)(this + 0x7c);
        }
        Msg("%5.2f : %s : %s : %5.3f\n",(double)*(float *)(gpGlobals + 0xc),puVar5,uVar3,
            (double)fVar8);
      }
    }
  }
  return;
}

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)