L L4D2node

CBasePlayerAnimState::UpdateFootYaws

0x00421c20 · 505 bytes · __thiscall

_ZN20CBasePlayerAnimState14UpdateFootYawsEv

Decompiled

undefined (1 param)

/* CBasePlayerAnimState::UpdateFootYaws() */

void __thiscall CBasePlayerAnimState::UpdateFootYaws(CBasePlayerAnimState *this)

{
  float fVar1;
  longdouble lVar2;
  float fVar3;
  float fVar4;
  float local_34;
  float local_30 [2];
  float local_28;
  float local_24;
  
  GetOuterAbsVelocity(this,(Vector *)&local_28);
  this[0x34] = (CBasePlayerAnimState)0x0;
  if (this[0x58] == (CBasePlayerAnimState)0x0) {
    this[0x58] = (CBasePlayerAnimState)0x1;
    *(undefined4 *)(this + 100) = 0;
    *(undefined4 *)(this + 0x54) = *(undefined4 *)(this + 0x1c);
    *(undefined4 *)(this + 0x30) = *(undefined4 *)(this + 0x1c);
    return;
  }
  if (SQRT(local_28 * local_28 + local_24 * local_24) <= 0.5) {
    fVar4 = *(float *)(gpGlobals + 0xc) - *(float *)(this + 100);
    if (fVar4 < *(float *)(mp_facefronttime._28_4_ + 0x2c) ||
        fVar4 == *(float *)(mp_facefronttime._28_4_ + 0x2c)) {
      lVar2 = (longdouble)AngleNormalize(*(float *)(this + 0x30) - *(float *)(this + 0x1c));
      fVar4 = *(float *)(this + 4);
      if (ABS((float)lVar2) <= fVar4) {
        return;
      }
      if ((float)lVar2 <= 0.0) {
        *(float *)(this + 0x30) = fVar4 + *(float *)(this + 0x30);
      }
      else {
        *(float *)(this + 0x30) = *(float *)(this + 0x30) - fVar4;
      }
      (**(code **)(*(int *)this + 0x68))(this);
      return;
    }
  }
  else if (1 < *(uint *)(this + 0xc)) {
    lVar2 = (longdouble)__atan2_finite((double)local_24,(double)local_28);
    fVar3 = (float)lVar2 * 57.295776;
    *(float *)(this + 0x30) = fVar3;
    sincosf(*(float *)(this + 0x1c) * 0.017453292,local_30,&local_34);
    fVar1 = local_30[0];
    fVar4 = local_34;
    sincosf(fVar3 * 0.017453292,local_30,&local_34);
    if (-0.01 <= fVar1 * local_30[0] + fVar4 * local_34) {
      return;
    }
    *(float *)(this + 0x30) = fVar3 + 180.0;
    return;
  }
  *(undefined4 *)(this + 0x30) = *(undefined4 *)(this + 0x1c);
  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)