L L4D2node

CBasePlayerAnimState::CalcMovementPlaybackRate

0x00421550 · 208 bytes · __thiscall

_ZN20CBasePlayerAnimState24CalcMovementPlaybackRateEPb

Decompiled

undefined (2 params)

/* CBasePlayerAnimState::CalcMovementPlaybackRate(bool*) */

longdouble __thiscall
CBasePlayerAnimState::CalcMovementPlaybackRate(CBasePlayerAnimState *this,bool *param_1)

{
  char cVar1;
  float fVar2;
  float fVar3;
  float local_18;
  float local_14;
  
  GetOuterAbsVelocity(this,(Vector *)&local_18);
  *param_1 = false;
  fVar2 = SQRT(local_18 * local_18 + local_14 * local_14);
  if ((0.5 < fVar2) && (cVar1 = (**(code **)(*(int *)this + 0x40))(this), cVar1 != '\0')) {
    fVar3 = 0.01;
    if (0.001 <= *(float *)(this + 0x90)) {
      fVar2 = fVar2 / *(float *)(this + 0x90);
      fVar3 = 10.0;
      if ((fVar2 <= 10.0) && (fVar3 = fVar2, fVar2 <= 0.01)) {
        fVar3 = 0.01;
      }
    }
    *param_1 = true;
    return (longdouble)fVar3;
  }
  return (longdouble)1.0;
}

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)