L L4D2node

CCSGameMovement::DecayPunchAngle

0x0042ec20 · 442 bytes · __thiscall

_ZN15CCSGameMovement15DecayPunchAngleEv

Decompiled

undefined (1 param)

/* CCSGameMovement::DecayPunchAngle() */

void __thiscall CCSGameMovement::DecayPunchAngle(CCSGameMovement *this)

{
  int iVar1;
  longdouble lVar2;
  float fVar3;
  float fVar4;
  float local_18;
  float local_14;
  float local_10;
  
  iVar1 = *(int *)(this + 0x7e0);
  if (iVar1 == 0) {
    return;
  }
  local_18 = *(float *)(iVar1 + 0x1ab0);
  local_14 = *(float *)(iVar1 + 0x1ab4);
  local_10 = *(float *)(iVar1 + 0x1ab8);
  lVar2 = (longdouble)VectorNormalize((Vector *)&local_18);
  iVar1 = *(int *)(this + 0x7e0);
  fVar3 = (float)lVar2 -
          ((float)lVar2 * 0.5 + *(float *)(PunchAngleDecayRate._28_4_ + 0x2c)) *
          *(float *)(gpGlobals + 0x10);
  if (fVar3 <= 0.0) {
    fVar3 = 0.0;
  }
  fVar4 = local_18 * fVar3;
  local_14 = local_14 * fVar3;
  local_10 = fVar3 * local_10;
  local_18 = fVar4;
  if (fVar4 == *(float *)(iVar1 + 0x1ab0)) {
    if (local_14 != *(float *)(iVar1 + 0x1ab4)) {
LAB_0042ed50:
      fVar3 = local_14;
      (**(code **)(*(int *)(iVar1 + 0x1a40) + 4))(iVar1 + 0x1a40,iVar1 + 0x1ab0);
      *(float *)(iVar1 + 0x1ab4) = fVar3;
      iVar1 = *(int *)(this + 0x7e0);
      if (local_10 == *(float *)(iVar1 + 0x1ab8)) {
        return;
      }
      goto LAB_0042ed18;
    }
  }
  else {
    (**(code **)(*(int *)(iVar1 + 0x1a40) + 4))(iVar1 + 0x1a40,iVar1 + 0x1ab0);
    *(float *)(iVar1 + 0x1ab0) = fVar4;
    iVar1 = *(int *)(this + 0x7e0);
    if (local_14 != *(float *)(iVar1 + 0x1ab4)) goto LAB_0042ed50;
  }
  if (local_10 == *(float *)(iVar1 + 0x1ab8)) {
    return;
  }
LAB_0042ed18:
  fVar3 = local_10;
  (**(code **)(*(int *)(iVar1 + 0x1a40) + 4))(iVar1 + 0x1a40,iVar1 + 0x1ab0);
  *(float *)(iVar1 + 0x1ab8) = fVar3;
  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)