L L4D2node

CFourWheelVehiclePhysics::SteeringRest

0x006aea80 · 175 bytes · __thiscall

_ZN24CFourWheelVehiclePhysics12SteeringRestEfRK15vehicleparams_t

Decompiled

undefined (3 params)

/* CFourWheelVehiclePhysics::SteeringRest(float, vehicleparams_t const&) */

void __thiscall
CFourWheelVehiclePhysics::SteeringRest
          (CFourWheelVehiclePhysics *this,float param_1,vehicleparams_t *param_2)

{
  float fVar1;
  longdouble lVar2;
  float fVar3;
  float fVar4;
  
  fVar4 = *(float *)(param_2 + 0x278);
  fVar1 = *(float *)(param_2 + 0x274);
  fVar3 = *(float *)(param_2 + 0x26c);
  if (fVar4 == fVar1) {
    fVar3 = (float)(~-(uint)(param_1 < fVar4) & (uint)*(float *)(param_2 + 0x270) |
                   (uint)fVar3 & -(uint)(param_1 < fVar4));
  }
  else {
    fVar4 = (param_1 - fVar1) / (fVar4 - fVar1);
    if (1.0 <= fVar4) {
      fVar4 = 1.0;
    }
    if (fVar4 <= 0.0) {
      fVar4 = 0.0;
    }
    fVar3 = fVar3 + fVar4 * (*(float *)(param_2 + 0x270) - fVar3);
  }
  lVar2 = (longdouble)Approach(0.0,*(float *)(this + 0x10),fVar3 * *(float *)(gpGlobals + 0x10));
  *(float *)(this + 0x10) = (float)lVar2;
  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)