L L4D2node

CMultiPlayerAnimState::CalcMovementPlaybackRate

0x0046cb50 · 186 bytes · __thiscall

_ZN21CMultiPlayerAnimState24CalcMovementPlaybackRateEPb

Decompiled

undefined (2 params)

/* CMultiPlayerAnimState::CalcMovementPlaybackRate(bool*) */

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

{
  longdouble lVar1;
  float fVar2;
  float fVar3;
  float local_18;
  float local_14;
  
  GetOuterAbsVelocity(this,(Vector *)&local_18);
  *param_1 = false;
  fVar2 = SQRT(local_14 * local_14 + local_18 * local_18);
  if (0.5 < fVar2) {
    lVar1 = (longdouble)(**(code **)(*(int *)this + 0x6c))(this);
    fVar3 = 0.01;
    if (0.001 <= (float)lVar1) {
      fVar2 = fVar2 / (float)lVar1;
      *param_1 = true;
      if (0.01 <= fVar2) {
        fVar3 = fVar2;
      }
      if (10.0 <= fVar3) {
        fVar3 = 10.0;
      }
    }
    else {
      *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)