L L4D2node

CBaseAnimating::GetInstantaneousVelocity

0x005e32d0 · 423 bytes · __thiscall

_ZN14CBaseAnimating24GetInstantaneousVelocityEf

Decompiled

undefined (2 params)

/* CBaseAnimating::GetInstantaneousVelocity(float) */

longdouble __thiscall CBaseAnimating::GetInstantaneousVelocity(CBaseAnimating *this,float param_1)

{
  float fVar1;
  int iVar2;
  CStudioHdr *pCVar3;
  longdouble lVar4;
  float fVar5;
  float fVar6;
  float local_18;
  float local_14;
  float local_10;
  
  pCVar3 = *(CStudioHdr **)(this + 0x13e0);
  if (pCVar3 == (CStudioHdr *)0x0) {
    iVar2 = CBaseEntity::GetModel((CBaseEntity *)this);
    if (iVar2 == 0) {
      pCVar3 = *(CStudioHdr **)(this + 0x13e0);
    }
    else {
      LockStudioHdr(this);
      pCVar3 = *(CStudioHdr **)(this + 0x13e0);
    }
    fVar5 = 0.0;
    if (pCVar3 == (CStudioHdr *)0x0) goto LAB_005e33fd;
  }
  if (*(int *)pCVar3 == 0) {
    fVar5 = 0.0;
  }
  else {
    fVar5 = *(float *)(this + 0x490);
    lVar4 = (longdouble)SequenceDuration(this,pCVar3,*(int *)(this + 0x494));
    fVar6 = 10.0;
    if (0.0 < (float)lVar4) {
      fVar6 = 1.0 / (float)lVar4;
    }
    fVar1 = *(float *)(this + 0x528);
    if (fVar1 < 0.0) {
      fVar6 = *(float *)(this + 0x468) * param_1 * fVar6;
    }
    else if (fVar1 <= 1.0) {
      fVar6 = *(float *)(this + 0x468) * param_1 * (1.0 - fVar1) * fVar6;
    }
    else {
      fVar6 = 0.0;
    }
    Studio_SeqVelocity(pCVar3,*(int *)(this + 0x494),fVar6 + fVar5,(float *)(this + 0x498),
                       (Vector *)&local_18);
    fVar5 = *(float *)(this + 0x528);
    fVar6 = *(float *)(this + 0x468);
    if ((0.0 <= fVar5) && (fVar6 = 0.0, fVar5 <= 1.0)) {
      fVar6 = *(float *)(this + 0x468) * (1.0 - fVar5);
    }
    fVar5 = SQRT(local_14 * fVar6 * local_14 * fVar6 + local_18 * fVar6 * local_18 * fVar6 +
                 fVar6 * local_10 * fVar6 * local_10);
  }
LAB_005e33fd:
  return (longdouble)fVar5;
}

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)